Remove and del


#1

what is the difference beween

list_name.remove()
list_name.del()

grateful for the explanation


#2

uhm...:

list_name.del()

you mean:

del list_name[index]

?

del removes based on index, where as remove removes the first value it can find:

list_name = ['a','b','c','d','e']
list_name.remove('e')
del list_name[0]

#3

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