-
Notifications
You must be signed in to change notification settings - Fork 97
/
quizgame.py
53 lines (43 loc) · 1.22 KB
/
quizgame.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
print("Welcome to my computer quiz! ")
playing = input("Do you want to play quiz game? ")
if playing.lower() != "yes":
quit()
print("okay let's play the game:) ")
score = 0
answer = input("What does RAM stand for? ").lower()
if answer == "random access memory":
print("correct!")
score +=1
else:
print("Incorrect!")
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 == "graphical processing unit":
print("correct!")
score +=1
else:
print("Incorrect!")
answer = input("What does CLI stand for? ").lower()
if answer == "command line interface":
print("correct!")
score +=1
else:
print("Incorrect!")
answer = input("What does DSA stand for? ").lower()
if answer == "data structure and algorithms":
print("correct!")
score +=1
else:
print("Incorrect!")
if score >=5:
print("congratulations😍 You got " + str(score) + " questions correct!")
print("You got " + str((score/4) * 100) + "%.")
elif score >=3:
print(" You got " + str(score) + " questions correct!")
else:
print("Oops! try again ☹ ")