I am trying to create a continuous user input but do not want it to restart from the start if a wrong info is put in. For e.g.,
a = 1
while a ==1:
Number = raw_input("Number: ")
if len(Number) != 3:
print "\n Error, please enter 4 digits \n"
else:
Day = raw_input("Day: ")
if not Day.isdigit():
print "\n Error, please enter day in digits \n"
Here, if the person enters a non-4 digit for the first input, the loop will end and go back to the start again. However, if he gets to the second input and enters a non-digit string, the loop will also end and go back to the start. How do I get it to not go back to the start but ask for the Day again?
a==1never becomes false becauseanever changes. If you want to end the loop, changea.