List method to delete last element in list as well as all elements

The Solution to List method to delete last element in list as well as all elements is


you can use lst.pop() or del lst[-1]

pop() removes and returns the item, in case you don't want have a return use del

~ Answered on 2011-12-02 14:54:03


Most Viewed Questions: