We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b304241 commit a9f8ffbCopy full SHA for a9f8ffb
python_projects/quiz_game.py
@@ -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