(7/10)

Getting Items From A List (List Indexing) — Python typing lesson

Access and retrieve specific items from lists using indexes.

What you'll practice

Let's pick a specific toy from our toy box! We use index numbers, and the count always starts from 0.

  • The first item in a list is at index 0.
  • The index number goes inside square brackets [].
🐍Python

Getting Items From A List (List Indexing)

0 WPM
0% Accuracy
0:00 Time elapsed
1
2
3
4
5
toy_box = ['robot', 'car', 'dinosaur']↵
print('The first toy is:')↵
print(toy_box[0])↵
print('The third toy is:')↵
print(toy_box[2])
0 / 128
Press This!
👇
`~
1!
2@
3#
4$
5%
6^
7&
8*
9(
0)
-_
=+
⌫
⇥
Q
W
E
R
T
Y
U
I
O
P
[{
]}
\|
⇪
A
S
D
F
G
H
J
K
L
;:
'"
↵
⇧
Z
X
C
V
B
N
M
,<
.>
/?
⇧
Thumb
Index
Middle
Ring
Pinky