+ 1
Why this method don't right?
# x.remove(obj) x = [1, 2, 6.06, 9] print(x.remove(1)) How to write, help please?
3 Respostas
+ 4
x = [1, 2, 6.06, 9]
x.remove(1)
print(x)
# "remove" returns "None" so "None is printed (in your code)..
+ 3
a=[1,2,3,4]
a.reverse()
print(a)
+ 2
Blokhin Roman
remove method doesn't return the removed element but pop() method do so when index number passed to it otherwise it will pop last element of list
print (x.pop(0))