added some final stage to the quiz

This commit is contained in:
samialazar 2020-06-26 15:58:27 +02:00
parent 38839f5d3b
commit 8561dbab9f
3 changed files with 15 additions and 7 deletions

View file

@ -0,0 +1 @@
sami@afro-linux-lenovo-b50-30.2711:1593172229

View file

@ -1 +0,0 @@
sami@afro-linux-lenovo-b50-30.18673:1593006374

View file

@ -29,13 +29,14 @@ questions = [
Question(question_prompts[9], "a"),
]
def run_quiz(questions):
def quiz(questions):
score = 0
for question in questions:
answer = input(question.prompt)
if answer == question.answer:
score += 5
print("Correct! Your score is", score,)
else:
print("Incorrect!")
@ -43,11 +44,18 @@ def run_quiz(questions):
print("You lost 3 points!")
print ("Score: ", score)
print ("\n")
# Final stage
score = 0
if score >= -30:
print("Your total score is:", score, "- You suck!")
elif score == 10 or 15 :
print("Your total score is:", score, "- You went ok!")
else:
print("Your total score is:", score, "- You are awesome!")
run_quiz(questions)
quiz(questions)