April 2017
Beginner to intermediate
312 pages
7h 23m
English
The remove() method finds the first instance of the element (passed an argument) and removes it from the list. Let's consider the following examples:
>>> sequence = [1, 1, 2, 3, 4, 7, 5, 6, 7] >>> sequence.remove(7) >>> sequence [1, 1, 2, 3, 4, 5, 6, 7]
>>> sequence.remove(1) >>> sequence [1, 2, 3, 4, 5, 6, 7]
>>> sequence.remove(1) >>> sequence [2, 3, 4, 5, 6, 7]
Read now
Unlock full access