If I want to remove a value from a list in python, is it proper to use del
or can I just use pop()
even though it returns the popped value?
I know the difference in how they can be used I just want to know specifically in terms of deleting from a list if I should be using del
instead of pop()
for everything.
list = [1, 2, 3]
del list[0]
vs.
list = [1, 2, 3]
list.pop(0)