I am writing python script that need to provide multiple input (my case more than 20).
I am terminating program whenever they provided wrong inputs due to this users facing some difficulties say for example they provided all 19 correct inputs and the last input provided wrongly by mistake and program gets terminated and they end up by re run the script and provide all 20 inputs again.
Below is my code:
print('1)INT\n2)US\n3)UK\n4)China')
geo = raw_input('Please choose the Geography:')
while geo != '1' and geo != '2' and geo != '3' and geo != '4':
print('Error: Provide proper input and tool terminated. Please re Run the tool ')
quit()
Instead of this I need to give three chances and if they failed to 3 times then I need terminate the program.
Please advice.