List Methods Flashcards

1
Q

Definition of List

A

List is a collection which is ordered and changeable. Allows duplicate members.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

list.clear()

A

Removes all elements from the list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

list.copy()

A

Returns a copy of the list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

list.count()

A

Returns the number of elements with a specified value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

list.extend()

A

Add the elements of a list to the end of the current list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

list.index()

A

Returns the index of the first occurrence of a value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

list.insert()

A

Adds an element at a specified location.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

list.pop()

A

Removes the element at the specified location.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

list.remove()

A

Removes the item with the specified value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

list.reverse()

A

Reverses the order of the list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

list.sort()

A

Sorts the list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

list.append()

A

Adds an element to the end of the list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly