Advertisement
suewalters

Week 2 - 2.11 Practice

Apr 26th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. score=0
  2. print ("Welcome to Trivial Trivia")
  3. print ("Answer three questions about simple machines and earn a trivia badge.")
  4. print ("Question Number 1")
  5. q1=input("What kind of simple machine is a seesaw? ")
  6. if q1=="lever" or q1=="Lever":
  7. print("You are correct. The answer is "+q1+".")
  8. score=score+1
  9. else:
  10. print("I am sorry. The answer is not "+q1+".")
  11. intscore=str(score)
  12. print("Your current score is "+intscore+".")
  13. q2=input("What kind of simple machine is an ax? ")
  14. if q2=="wedge" or q2=="Wedge":
  15. print("You are correct. The answer is "+q2+".")
  16. score=score+1
  17. else:
  18. print("I am sorry. The answer is not "+q2+".")
  19. intscore=str(score)
  20. print("Your current score is "+intscore+".")
  21. q3=input("What kind of simple machine is a window shade? ")
  22. if q3=="pulley" or q3=="Pulley":
  23. print("You are correct. The answer is "+q3+".")
  24. score=score+1
  25. else:
  26. print("I am sorry. The answer is not "+q3+".")
  27. intscore=str(score)
  28. print("Your current score is "+intscore+".")
  29. if score==0:
  30. print("Your score is "+intscore+" I am sorry you did not receive a badge. Please try again.")
  31. elif score==1:
  32. print("Your score is "+intscore+" You are awarded the Trivia Novice Badge.")
  33. elif score==2:
  34. print("Your score is "+intscore+" You are awarded the Trivia Proficiency Badge.")
  35. else:
  36. print("Your score is "+intscore+" You are awarded the Trivia Expert Badge.")
  37. print ("Thank you for playing Trivial Trivia!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement