-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz_game.py
More file actions
123 lines (95 loc) · 2.81 KB
/
quiz_game.py
File metadata and controls
123 lines (95 loc) · 2.81 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import time
print("\nHey! Welcome to my quiz!\n")
play = input("Do you want to play? ")
if play.lower() != "yes":
print("See you later!")
quit()
print("Okay! Let's play ")
print("...preparing the game...")
score = 0
## Question 1
answer = input("What is the world's longest river called? ")
if answer.lower() == "nile":
print("Correct!")
score += 1
else:
print("Incorrect!")
## Question 2
answer = input("Which planet is closest to Earth? ")
if answer.lower() == "venus":
print("Correct!")
score += 1
else:
print("Incorrect!")
## Question 3
answer = input("What language is the most popularly spoken worldwide? ")
if answer.lower() == "chinese":
print("Correct!")
score += 1
else:
print("Incorrect!")
## Question 4
answer = input("What city is known as the City of Love? ")
if answer.lower() == "paris":
print("Correct!")
score += 1
else:
print("Incorrect!")
## Question 5
answer = input("How many days are in a leap year? ")
if answer.lower() == "366":
print("Correct!")
score += 1
else:
print("Incorrect!")
## Question 6
answer = input("Who founded Microsoft? ")
if answer.lower() == "bill gates":
print("Correct!")
score += 1
else:
print("Incorrect!")
## Question 7
answer = input("Which country is known to consume the most chocolate? ")
if answer.lower() == "switzerland":
print("Correct!")
score += 1
else:
print("Incorrect!")
## Question 8
answer = input("What blonde-haired singer sings the song “You Belong With Me”? ")
if answer.lower() == "taylor swift":
print("Correct!")
score += 1
else:
print("Incorrect!")
## Question 9
answer = input("What's the name of the company that published the Mario Kart video game? ")
if answer.lower() == "nintendo":
print("Correct!")
score += 1
else:
print("Incorrect!")
print("Okay, this is your last question...")
ready = input("Are you ready? ")
if ready == "no":
print("Well, I'll give you a few seconds")
time.sleep(5)
print("Time is up!")
time.sleep(2)
## Question 10
answer = input("In Greek mythology, who had snakes for hair and could turn people into stone if they looked at her? ")
if answer.lower() == "medusa":
print("Correct!")
score += 1
else:
print("Incorrect!")
if score == 10:
print("\nCongrats!! You did an excellent job!! You got " + str(score) + "/10 or " + str(score/10 * 100) + "% :)")
elif score >= 7 and score <= 9:
print("\nWow! You did great! You got " + str(score) + "/10 or " + str(score/10 * 100) + "%")
elif score >= 4 and score <= 6:
print("\nThat was good! You got " + str(score) + "/10 or " + str(score/10 * 100) + "%")
elif score <= 3:
print("\nOh, that's okay, you will do better next time! You got " + str(score) + "/10 or " + str(score/10 * 100) + "%")
print("\nI hope you had fun, thanks for playing!")