Nuttige ingebouwde functies for lists Flashcards

1
Q

my_list.append()

A

add the item at the end of the list

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

my_list.clear()

A

clears a whole list

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

my_list.copy()

A

copies the old list, doesn’t update it

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

my_list.count(‘Bob’)

A

you get the amount of Bob’s in the list

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

my_list.extend()

A

add elements of a list to another list, make it one list

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

my_list.index(‘Bob’)

A

you get the index number of Bob in the list

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

my_list.insert(i, b)

A

insert item b at the position of i

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

my_list.pop(i)

A

remove i’th element from list and return it, otherwise delete
last element

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

my_list.remove(x)

A

remove it from the list

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

print(len(my_list))

A

aantal indexes

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

my_list.reverse()

A

revers the list (NO RETURN VALUE)

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

my_list.sort()

A

sorts the elements of the list

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

print(max(my_list))

A

hoogste cijfer uit de lijst

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

print(min(my_list))

A

laagste cijfer uit de lijst

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

print(sum(my_list))

A

alles bij elkaar opgeteld

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

print(my_list[2])

A

gives the name or word at the index number 2

16
Q

print(one_list + another_list)

A

concatenation

17
Q

print(my_list * 3)

A

repetition

18
Q

print(“meaning” in my_list)

A

membership