Jayteepix

Untitled

Oct 18th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. #Quiz the User
  2. #Note: Show me how to write this better if you can find time but
  3. # please just use the constructs we have been taught so far
  4. # I don't like the hanging ELSEs for example...
  5. #
  6. print("Geography")
  7. print ("Qu.1")
  8. print ("In Australia the Sun appears in the Northern Sky.")
  9. score = int(0)
  10. answer = input("Please enter 'Yes' or 'No' or 'Pass' ")
  11. if answer != "Yes" and answer != "No" and answer != "Pass" :
  12. print("Invalid Option entered")
  13. print("Bye")
  14. else:
  15. if answer == "Pass":
  16. print("OK - maybe you could Google the question and come back?")
  17. print("bye")
  18. else:
  19. if answer == "Yes":
  20. print("Correct - Well Done - go on to question 2.")
  21. score = score + 1
  22. if answer == "No":
  23. print("Wrong - Sorry - go on to question 2.")
  24. #Qu 2
  25. print ("Qu.2")
  26. print ("Kenya is on the equator. ")
  27. answer = input("Please enter 'Yes' or 'No' or 'Pass' ")
  28. if answer != "Yes" and answer != "No" and answer != "Pass" :
  29. print("Invalid Option entered")
  30. print("Bye")
  31. else:
  32. if answer == "Pass":
  33. print("OK could you Google the question and come back? ")
  34. print("Your score was ")
  35. print(str(score) + " out of 2")
  36. print("bye")
  37. else:
  38. if answer == "Yes":
  39. print("Correct - your score was ")
  40. score = score + 1
  41. if answer == "No":
  42. print("Wrong - Sorry, your score was ")
  43. print(str(score) + " out of 2")
  44. print("Bye")
Advertisement
Add Comment
Please, Sign In to add comment