(birthday_string)
return today.year - birthyear - ((today.month, today.day) < (birthmonth, birthday))
Converts from '1997-03-25T22:49:41.151Z' to an integer (age)
Converts from '1997-03-25T22:49:41.151Z' to an integer (age)
Converts from 1997 - 03 - 25T22 : 49 : 41 . 151Z to an integer ( age )
def calculate_age(birthday_string):
    '''
    Converts from '1997-03-25T22:49:41.151Z' to an integer (age)
    '''
    birthyear = int(birthday_string[:4])
    birthmonth = int(birthday_string[5:7])
    birthday = int(birthday_string[8:10])
    today = date.today()
    return today.year - birthyear - ((today.month, today.day) < (birthmonth, birthday))
def calculate_age ( birthday_string ) : birthyear = int ( birthday_string [ : 4 ] ) birthmonth = int ( birthday_string [ 5 : 7 ] ) birthday = int ( birthday_string [ 8 : 10 ] ) today = date . today ( ) return today . year - birthyear - ( ( today . month , today . day ) < ( birthmonth , birthday ) )