-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex34.py
More file actions
24 lines (22 loc) · 743 Bytes
/
ex34.py
File metadata and controls
24 lines (22 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Exercise 34, Learning Python the Hard Way"""
ANIMALS = ['bear', 'python', 'peacock', 'kangaroo', 'whale', 'platypus']
print "The list of animals is: ",
for i in ANIMALS:
print i,
print "\n"
# The animal at 1.
print "The animal at 1 is: " + ANIMALS[1]
# The third (3rd) animal.
print "The third (3rd) animal is: " + ANIMALS[2]
# The first (1st) animal.
print "The first (1st) animal is: " + ANIMALS[0]
# The animal at 3.
print "The animal at 3 is: " + ANIMALS[3]
# The fifth (5th) animal.
print "The fifth (5th) animal is: " + ANIMALS[4]
# The animal at 2.
print "The animal at 2 is: " + ANIMALS[2]
# The sixth (6th) animal.
print "The sixth (6th) animal is: " + ANIMALS[5]
# The animal at 4.
print "The animal at 4 is: " + ANIMALS[4]