Question: How would you modify this so that your program prompts the user for a random addition problem instead of always asking them to answer What
How would you modify this so that your program prompts the user for a random addition problem instead of always asking them to answer "What is 2+2?".
correct_answer = 4 while True: user_answer = int(input("What is 2 + 2? ")) if(user_answer == correct_answer): print("Correct. Congratulations!") break else: print("wrong, try again")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
