-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquiz_game.py
38 lines (31 loc) · 825 Bytes
/
quiz_game.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
print("Welcome to the quiz game!")
playing = input("Do you want to play? (yes or no)? ")
if playing.lower() != "yes":
quit()
score = 0
answer = input("What is a cpu? ").lower()
if answer != "central processing unit":
print("Incorrect!")
else:
print("Correct!")
score+=1
answer = input("What is a gpu? ").lower()
if answer != "graphics processing unit":
print("Incorrect!")
else:
print("Correct!")
score+=1
answer = input("What is a ram? ").lower()
if answer != "random access memory":
print("Incorrect!")
else:
print("Correct!")
score+=1
answer = input("What is a psu? ").lower()
if answer != "power supply":
print("Incorrect!")
else:
print("Correct!")
score+=1
print("You got " + str(score) + " questions correct!")
print("You got " + str((score/4) * 100) + "%.")