-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz_game.py
More file actions
49 lines (38 loc) · 1.16 KB
/
Copy pathquiz_game.py
File metadata and controls
49 lines (38 loc) · 1.16 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
score = 0
highscore = 0
decision = "yes"
name = input("Type your name: ")
print("\nWelcome to my computer quiz,", name + "!")
playing = input("\nDo you want to play? ")
if playing.lower() != "yes":
print("\nComputer quiz ending...")
quit()
print("\nOkay! Let's play :)")
while decision.lower() == "yes":
answer = input("\nWhat does CPU stand for? ")
if answer.lower() == "central processing unit":
print("Correct!")
score += 1
else:
print("Incorrect!")
answer = input("\nWhat is RA 1425? ")
if answer.lower() == "rizal law":
print("Correct!")
score += 1
else:
print("Incorrect!")
answer = input("\nWhat is the hottest planet in the solar system? ")
if answer.lower() == "venus":
print("Correct!")
score += 1
else:
print("Incorrect!")
print("\nYou got " + str(score) + " questions correct!")
print("You got " + str((score / 3) * 100) + "%")
if highscore > score:
print("Highscore:", highscore)
else:
highscore = score
print("New highscore:", highscore)
score = 0
decision = input("\nDo you want to play again? ")