How do u get stuff out of a list in python3(the opposit of append)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do u get stuff out of a list in python3(the opposit of append)?

11th Apr 2019, 9:57 AM
TIB
4 Answers
+ 7
l = [1, 2] l.append(3) print(l) # [1, 2, 3] n = l.pop() print(n) # 3 print(l) # [1, 2] n = l.pop() print(n) # 2 print(l) # [1]
11th Apr 2019, 10:28 AM
Anna
Anna - avatar
+ 1
You can get a list of all the available list methods by printing dir(list). You can get information of all the available list methods by executing help("list")
11th Apr 2019, 11:57 AM
Seb TheS
Seb TheS - avatar
0
Thx
11th Apr 2019, 7:32 PM
TIB