I'm trying to get this loop to return to the the question of inputting user input until they decide to exit the program (choose selection 7), I'm having trouble figuring it out.
selection = input("Select 1 2 3 OR 7 ")
while selection != "7":
if selection == "1":
print("1 is selected")
l = int(input("INPUT ? "))
print("answer IS: ", l ** 2)
break
elif selection == "2":
print("2 is selected")
l = int(input("INPUT ? "))
w = int(input("INPUT ? "))
print("answer is: ", l * w)
break
elif selection == "3":
print("3 is selected")
r = int(input("INPUT ? "))
print("answer IS: ", (r ** 2) * 3.14)
break
elif selection == "7":
print("BYE")
The code works but I need to get it so that after it provides you with an answer, it'll ask you for the input again until you select 7 to exit. I just can't seem to get that part of it working.