Skip to content

Commit a9f8ffb

Browse files
committed
getting familiar with python
1 parent b304241 commit a9f8ffb

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

python_projects/quiz_game.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
print("Welcome to the QUIZ GAME!")
2+
3+
playing = input("Do you want to play? ").lower()
4+
5+
if playing != "yes":
6+
quit()
7+
8+
score = 0
9+
10+
print("Let's play!")
11+
12+
questions = [
13+
"What does CPU stand for? ",
14+
"What does GPU stand for? ",
15+
"What does PSU stand for? ",
16+
"What does RAM stand for? "
17+
]
18+
answers = [
19+
"central processing unit",
20+
"graphics processing unit",
21+
"power supply",
22+
"random access memory"
23+
]
24+
25+
for i in [0,1,2,3]:
26+
answer = input(questions[i]).lower()
27+
if answer == answers[i]:
28+
print("CORRECT!")
29+
score+=1
30+
else:
31+
print("INCORRECT!")
32+
33+
print("You got "+str(score)+" questions right out of 4")
34+
print("You got "+str((score/4)*100)+"%.")

0 commit comments

Comments
 (0)