def correct_answer(number_correct): number_correct = number_correct + 1 sounds.play_a_sound("carhorn.wav") return(number_correct)
def wrong_answer(number_wrong): number_wrong = number_wrong + 1 sounds.play_a_sound("ohno.wav") return(number_wrong)
#!/usr/bin/python3 import sounds number_asked = 0 number_correct = 0 number_wrong = 0 choice = input("Press 1 for correct, 2 for incorrect or 0 to end: ") while choice != "0": if choice == "1": number_asked = number_asked + 1 number_correct = number_correct + 1 sounds.play_a_sound("carhorn.wav") if choice == "2": number_asked = number_asked + 1 number_wrong = number_wrong + 1 sounds.play_a_sound("ohno.wav") choice = input("Press 1 for correct, 2 for incorrect, or 0 to end: ") print("Asked questions: " + str(number_asked)) print("Answers correct: " + str(number_correct)) print("Wrong: " + str(number_wrong))