0
How do u get stuff out of a list in python3(the opposit of append)?
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]
+ 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")
0
Thx