This program is supposed to do basic calculations by asking the user what type of calculation it wants to perform, then it collects two numbers via the user input and finally performs the calculation by spitting it out before asking you to close it. In the else statement I have here, if the user doesn't input what I want them to, it'll tell them to read more carefully and then it restarts the program. What I want to do is make it so that if the else statement has been executed 3 or 4 times, it will print "I give up" and then it asks the user to type anything to exit the program. I'm a beginner too!
while True:
Pick = input("add, sub, multiply, or divide? :")
# Pick the calculation and then actually do it
if Pick == "add":
num_one = float(input("First number: "))
num_two = float(input("Second number:"))
if num_one == 9 and num_two == 10:
print("Twenty one? You stupid.")
Exit = input("Type literally anything to exit ")
break
print("The sum is : ", num_one + num_two)
Exit = input("Type literally anything to exit ")
break
elif Pick == "sub":
num_one = float(input("First number: "))
num_two = float(input("Second number:"))
print("The result is : ", num_one - num_two)
Exit = input("Type literally anything to exit ")
break
elif Pick == "multiply":
num_one = float(input("First number: "))
num_two = float(input("Second number:"))
print("The product is : ", num_one * num_two)
Exit = input("Type literally anything to exit ")
break
elif Pick == "divide":
num_one = float(input("First number: "))
num_two = float(input("Second number:"))
print("The quoitient is : ", num_one / num_two)
Exit = input("Type literally anything to exit ")
break
else:
print("Read and type exactly what it says in the beginning.")
continue