#setBirthday sets their Birthday to a date
def setBirthday(self):
while True:
try:
day = int(raw_input('Please enter the date of the month (1-31) you were born on here ->'))
if day <= 0 or day >= 32:
print "better try again..."
except ValueError:
continue
else:
break
month = int(raw_input('Please enter the month of the year (1-12) you were born on here ->'))
if month <= 0 or day >= 13:
print "better try again..."
except ValueError:
continue
else:
break
year = int(raw_input('Please enter the year you were born (19xx or 20xx) here ->'))
self.birthday = datetime(year, month, day)
print str(varPerson.getName()) + " you were born on " + str(month) + "/" + str(day) + "/" + str(year)
The indentation error is just above varPerson the last 3 lines. I have tried and tried to get this scenario working with exceptions to be able to have a smooth running script that allows for additional tries if value is not appropriate. Suggestions? I have been using this link for help: