def playWithAge(): '''Simple function to tell your birthyear''' # new constant value NOW = 2018 print('Which year were you born in?') # instantiation of the problem; # year is a string at the moment year = input() # new variable age = NOW - int(year) print('You must be ' + str(age-1) + ' or ' + str(age)) # this not nice: 1980 and 1997 should be constants, like NOW if (int(year) > 1980 and int(year) < 1997): print('Aw, you are a Millenial!') playWithAge()