Upload your study docs or become a
Course Hero member to access this document
Unformatted text preview: print("That's the correct answer") count +=1 else: print("That's incorrect") print(f"Your score: {count}") def get_quiz_choice(): while True: try: quiz_number = int(input('Choose the quiz you like\n1 for {}\n2 for {}\n3 for {}\nYour choice: '.format(animals_questions, capitals_questions, math_questions))) except ValueError: print("Not a number, please try again.\n") else: if quiz_number in [1, 2, 3]: return quiz_number else: print('Invalid value, please try it again.') print() def get_answer(question, correct_answer): while True: try: print("Q: {}".format(question)) answer = int(input("1 for True\n0 for False\nYour answer: ")) except ValueError: print ("Not a number, please try again\n") if answer not in [0,1]: print ("Invalid value, please try again\n") continue elif bool(answer) == correct_answer: return True elif bool(answer) != correct_answer: return False break if __name__ == "__main__": main()...
View
Full Document