added some final stage to the quiz
This commit is contained in:
parent
38839f5d3b
commit
8561dbab9f
3 changed files with 15 additions and 7 deletions
1
sami/learn-python-the-hard-way/.#learn-german.org
Symbolic link
1
sami/learn-python-the-hard-way/.#learn-german.org
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
sami@afro-linux-lenovo-b50-30.2711:1593172229
|
|
@ -1 +0,0 @@
|
||||||
sami@afro-linux-lenovo-b50-30.18673:1593006374
|
|
|
@ -29,13 +29,14 @@ questions = [
|
||||||
Question(question_prompts[9], "a"),
|
Question(question_prompts[9], "a"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def run_quiz(questions):
|
def quiz(questions):
|
||||||
score = 0
|
score = 0
|
||||||
for question in questions:
|
for question in questions:
|
||||||
answer = input(question.prompt)
|
answer = input(question.prompt)
|
||||||
if answer == question.answer:
|
if answer == question.answer:
|
||||||
score += 5
|
score += 5
|
||||||
print("Correct! Your score is", score,)
|
print("Correct! Your score is", score,)
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("Incorrect!")
|
print("Incorrect!")
|
||||||
|
@ -43,11 +44,18 @@ def run_quiz(questions):
|
||||||
print("You lost 3 points!")
|
print("You lost 3 points!")
|
||||||
print ("Score: ", score)
|
print ("Score: ", score)
|
||||||
print ("\n")
|
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!")
|
||||||
|
|
||||||
|
|
||||||
|
quiz(questions)
|
||||||
|
|
||||||
|
|
||||||
run_quiz(questions)
|
|
||||||
|
|
Loading…
Reference in a new issue