Python Flashcards

1
Q

lst=[10, 20, 30, 40, 50]

lst[:-1]

A

[10,20,30,40]

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

lst=[10, 20, 30, 40, 50]

lst[1:-1]

A

→[20,30,40]

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

lst=[10, 20, 30, 40, 50]

lst[::2]

A

lst[::2]→[10,30,50]

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

lst=[10, 20, 30, 40, 50]

lst[::-1]→

A

lst[::-1]→[50,40,30,20,10]

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

lst=[10, 20, 30, 40, 50]

lst[::-2]→

A

lst[::-2]→[50,30,10]

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

lst=[10, 20, 30, 40, 50]

lst[:]→

A

lst[:]→[10,20,30,40,50]

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

lst=[10, 20, 30, 40, 50]

lst[1:3]

A

lst[1:3]→[20,30]

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

lst=[10, 20, 30, 40, 50]

lst[-3:-1]→

A

lst[-3:-1]→[30,40]

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

lst=[10, 20, 30, 40, 50]

lst[:3]→

A

lst[:3]→[10,20,30]

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

lst=[10, 20, 30, 40, 50]

lst[3:]

A

lst[3:]→[40,50]

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