List Methods Flashcards
1
Q
Definition of List
A
List is a collection which is ordered and changeable. Allows duplicate members.
3
Q
list.clear()
A
Removes all elements from the list.
4
Q
list.copy()
A
Returns a copy of the list.
5
Q
list.count()
A
Returns the number of elements with a specified value.
6
Q
list.extend()
A
Add the elements of a list to the end of the current list.
7
Q
list.index()
A
Returns the index of the first occurrence of a value.
8
Q
list.insert()
A
Adds an element at a specified location.
9
Q
list.pop()
A
Removes the element at the specified location.
10
Q
list.remove()
A
Removes the item with the specified value.
11
Q
list.reverse()
A
Reverses the order of the list.
12
Q
list.sort()
A
Sorts the list.
13
Q
list.append()
A
Adds an element to the end of the list.