I'm trying to make a program and would like to implement a function that allows the user to quit whenever they enter "quit". My issue is that I want to get two inputs (also integers) at once so it looks like this:
try:
a, b = input("Enter two numbers: ").split()
except:
print("Enter two NUMBERS please! ")
try:
a = int(a)
b = int(b)
except:
print("Enter two NUMBERS please! ")
The try/except is mainly so if they enter words instead of numbers, it'll prompt them again for valid numbers. I would like to make it so that if the user enters "quit", then the program ends or runs another print function rather than giving a ValueError since it expects two values. I'm not sure how to accept only one specific value.
Thanks!