What do i wanna achieve:
# Prompts the user for a level,
# If the user does not input 1, 2, or 3, the program should prompt again.
# Randomly generates ten (10) math problems formatted as X + Y = , wherein each of X and Y is a non-negative integer with
# digits. No need to support operations other than addition (+).
# Prompts the user to solve each of those problems. If an answer is not correct (or not even a number), the program should output EEE and prompt the user again, allowing the user up to three tries in total for that problem. If the user has still not answered correctly after three tries, the program should output the correct answer.
# The program should ultimately output the userโs score: the number of correct answers out of 10.
# Structure your program as follows:
# wherein get_level prompts (and, if need be, re-prompts) the user for a level and returns 1, 2, or 3, and
# generate_integer returns a randomly generated non-negative integer with level digits or
# raises a ValueError if level is not 1, 2, or 3:
my program:
import random
level = 0
while True:
while (level != 1) and (level != 2) and (level != 3):
level = int(input("Level: "))
if (level == 1) or (level == 2) or (level == 3):
break
i=0
a=0
b=0
prob = []
while i != 10:
a = random.randint(1,100)
prob.append(a)
b = random.randint(1,100)
prob.append(b)
i += 1
print(prob)
problem: i'm getting the list 'prob' printed in infinite loop
How to Tackle this Problem