Skip to main content
Source Link
ojas mohril
  • 2.3k
  • 1
  • 16
  • 11

def validate_age(age): if age >=0 : return True return False while True: try: age = int(raw_input("Please enter your age:")) if validate_age(age): break except ValueError: print "Error: Invalid age." 
Post Made Community Wiki by ojas mohril