myList.remove(item) # Removes first instance of "item" from myList myList.pop(i) # Removes and returns item at myList[i]
myList = ['Item', 'Item', 'Delete Me!', 'Item'] del myList[2] # myList now equals ['Item', 'Item', 'Item']
list.remove(element)
>>> a = [0, 2, 3, 2] >>> a.remove(2) >>> a [0, 3, 2]
# removes item with given name in list list = [15, 79, 709, "Back to your IDE"] list.remove("Back to your IDE") # removes last item in list list.pop()
>>> a = ['a', 'b', 'c', 'd'] >>> a.remove('b') >>> print a ['a', 'c', 'd']
a = [10, 20, 30, 20] a.remove(20) # a = [10, 30, 20] # removed first instance of argument
list.remove(item)
l = list[1, 2, 3, 4] for i in range(len(list)): l.pop(i) # OR "l.remove(i)"