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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!