Mega Code Archive

 
Categories / Python / List
 

List pop([i])

# Remove the item at the given position in the list, and return it. If no index is  # specified, a.pop() removes and returns the last item in the list. The item is  # also removed from the list. (The square brackets around the i in the method  # signature denote that the parameter is optional, not that you should type square  # brackets at that position. You will see this notation frequently in the Python  # Library Reference.)  a = [66.25, 333, 333, 1, 1234.5] print a.pop(1) print a