-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz_game.py
More file actions
38 lines (33 loc) · 939 Bytes
/
Copy pathquiz_game.py
File metadata and controls
38 lines (33 loc) · 939 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
print("Welcome to my computer quiz")
playing = input("Do you want to play? (yes/no): ").lower()
if playing != "yes":
quit()
print("Okey let's play!")
score = 0
answer = input("What does CPU stand for? ").lower()
if answer == "central processing unit":
print("Correct!")
score += 1
else:
print("Incorrect!")
answer = input("What does GPU stand for? ").lower()
if answer == "graphics processing unit":
print("Correct!")
score += 1
else:
print("Incorrect!")
answer = input("What does RAM stand for? ").lower()
if answer == "random access memory":
print("Correct!")
score += 1
else:
print("Incorrect!")
answer = input("What does PSU stand for? ").lower()
if answer == "power supply unit":
print("Correct!")
score += 1
else:
print("Incorrect!")
print("You got " + str(score) + " questions correct!")
print(" You got " + str((score / 4) * 100) + "%.")
print("Thanks for playing!")