Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Quiz the User
- #Note: Show me how to write this better if you can find time but
- # please just use the constructs we have been taught so far
- # I don't like the hanging ELSEs for example...
- #
- print("Geography")
- print ("Qu.1")
- print ("In Australia the Sun appears in the Northern Sky.")
- score = int(0)
- answer = input("Please enter 'Yes' or 'No' or 'Pass' ")
- if answer != "Yes" and answer != "No" and answer != "Pass" :
- print("Invalid Option entered")
- print("Bye")
- else:
- if answer == "Pass":
- print("OK - maybe you could Google the question and come back?")
- print("bye")
- else:
- if answer == "Yes":
- print("Correct - Well Done - go on to question 2.")
- score = score + 1
- if answer == "No":
- print("Wrong - Sorry - go on to question 2.")
- #Qu 2
- print ("Qu.2")
- print ("Kenya is on the equator. ")
- answer = input("Please enter 'Yes' or 'No' or 'Pass' ")
- if answer != "Yes" and answer != "No" and answer != "Pass" :
- print("Invalid Option entered")
- print("Bye")
- else:
- if answer == "Pass":
- print("OK could you Google the question and come back? ")
- print("Your score was ")
- print(str(score) + " out of 2")
- print("bye")
- else:
- if answer == "Yes":
- print("Correct - your score was ")
- score = score + 1
- if answer == "No":
- print("Wrong - Sorry, your score was ")
- print(str(score) + " out of 2")
- print("Bye")
Advertisement
Add Comment
Please, Sign In to add comment