Is there any simple method to return to menu by entering a special key? If the user made a mistake while entering the input, user can return to main menu by pressing @ (a special key) key at the end of the input.
x = input("Enter first number: ")
Here, user enter 5, but want to exit by input @. So, x = 5@
I tried some including this
x=input("Enter first number: ")
print(int(a))
if x == "@":
exit()
Also tries this too
for x in ['0', '0$']:
if '0$' in x:
break
But, unable to handle numbers and string values together.