0

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

11th Apr 2019, 9:57 AM
TIB
4 Réponses
+ 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