-
Notifications
You must be signed in to change notification settings - Fork 0
/
quizgame.py
57 lines (46 loc) · 1.34 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
54
55
## QUIZ GAME!
# Ask the user many questions, and give how many questions she/he got correct together with the percentage.
#Welcome the user.
print("Welcome to my Statistics Quiz Game!")
# Ask the user whether they want to play a game.
playing=input("Would you like to play a Statistics quiz game? ")
if playing.lower() == "yes":
print("Okay! Let's start! ")
else:
print("Goodbye")
quit()
#Creating quiz questions and scores
score=0
number_of_questions=0
answer=input("What does ANOVA stand for? ")
number_of_questions+=1
if answer.lower()== "analysis of variance" :
print("Correct!")
score=score+1
else:
print("Wrong! ")
answer=input("What does CI stand for? ")
number_of_questions+=1
if answer.lower()== "confidence interval" :
print("Correct!")
score+=1
else:
print("Wrong! ")
answer=input("What does MSE stand for? ")
number_of_questions+=1
if answer.lower()== "mean square error" :
print("Correct!")
score+=1
else:
print("Wrong! ")
answer=input("What does SS stand for? ")
number_of_questions+=1
if answer.lower()== "sum of squares" :
print("Correct!")
score+=1
else:
print("Wrong! ")
# Tell how many questions the user got correct.
print(f"You got {score} question(s) correct!")
# Tell how much % the user got correct.
print(f"You got {(score/number_of_questions)*100} percent correct!")