Removing elements from lists (return)


#1

del(n[1]) is like .pop in that it will remove the item at the given index, but it won't return it:

what does it mean that it won't return it? why do I need the index from a item returned?
what does returned mean then?


#2

If you want to process the last value of a list and remove it at the same time, you can use list.pop

del is a statement so it has no result/return value, it just has the side effect that something is removed


#3

A post was split to a new topic: Question about return