Difference between del and .remove?


Can somebody please explain to me what the difference between del and .remove? In which case do I use one or the other?

Replace this line with your code.


del removes based on index, remove() based on item:

x = ["a", "b", "c", "d", "e"]
del x[0]


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.