My code is not allowing me to break out of the infinite loop, and therefore exit the program. Here is my code:
while True:
print("\n1. Surname\n2. D.O.B\n3. Quit")
try:
select = int(input("Please select an option: "))
if select == 1:
surnameSearch()
elif select == 2:
DOB_search(BkRdr)
elif search == 3:
break
except:
print("That was an incorrect option, please try again:")
Here is what the input/output looks like:
1. Surname
2. D.O.B
3. Quit
Please select an option: 3
That was an incorrect option, please try agan:
1. Surname
2. D.O.B
3. Quit
Please select an option: