-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex34.py
65 lines (54 loc) · 1.99 KB
/
ex34.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
animals = [ 'bear', 'python', 'peacock', 'kangaroo', 'whale', 'platypus' ]
print animals
score = 2
print float( 2/8 )
print "Your score is %d of 8, or %d percent." % ( score, (score/8)*100 )
print "The animal at 1 is a . . . "
animal_input = raw_input( "> " )
print "You said the animal at 1 is a " + animal_input
if animal_input == animals[ 1 ]:
score = 1
print "The correct answer is '%s'.\n" % animals[ 1 ]
print "The 3rd animal is a . . . "
animal_input = raw_input( "> " )
print "You said the 3rd animal is a " + animal_input
if animal_input == animals[ 2 ]:
score += 1
print "The correct answer is '%s'.\n" % animals[ 2 ]
print "The 1st animal is a . . . "
animal_input = raw_input( "> " )
print "You said the 1st animal is a " + animal_input
if animal_input == animals[ 0 ]:
score += 1
print "The correct answer is '%s'.\n" % animals[ 0 ]
print "The animal at 3 is a . . . "
animal_input = raw_input( "> " )
print "You said the animal at 3 is a " + animal_input
if animal_input == animals[ 3 ]:
score += 1
print "The correct answer is '%s'.\n" % animals[ 3 ]
print "The 5th animal is a . . . "
animal_input = raw_input( "> " )
print "You said the 5th animal is a " + animal_input
if animal_input == animals[ 4 ]:
score += 1
print "The correct answer is '%s'.\n" % animals[ 4 ]
print "The animal at 2 is a . . . "
animal_input = raw_input( "> " )
print "You said the animal at 2 is a " + animal_input
if animal_input == animals[ 2 ]:
score += 1
print "The correct answer is '%s'.\n" % animals[ 2 ]
print "The 6th animal is a . . . "
animal_input = raw_input( "> " )
print "You said the 6th animal is a " + animal_input
if animal_input == animals[ 1 ]:
score += 1
print "The correct answer is '%s'.\n" % animals[ 5 ]
print "The animal at 4 is a . . . "
animal_input = raw_input( "> " )
print "You said the animal at 4 is a " + animal_input
if animal_input == animals[ 1 ]:
score += 1
print "The correct answer is '%s'.\n" % animals[ 4 ]
print "Your score is %d of 8, or %d percent." % ( score, (score/8)*100 )