# Birthdays.py Copyright (c) Kari Laitinen # http://www.naturalprogramming.com # 2006-05-01 File created. # 2009-01-22 class ISODate used in place of Date # 2022-12-18 Converted to Python 3. # During compilation and execution, the file ISODate.py must be in # the same folder together with this program. from ISODate import ISODate print( "\n Type in your date of birth as YYYY-MM-DD" \ "\n Use four digits for the year and two digits" \ "\n for the month and day: ", end="" ) date_of_birth_as_string = input() date_of_birth = ISODate( date_of_birth_as_string ) print( "\n You were born on a %s" % date_of_birth.get_day_of_week() ) print( " Here are your days to celebrate. You are" ) years_to_celebrate = 10 while years_to_celebrate < 80 : date_to_celebrate = ISODate( date_of_birth.year() + years_to_celebrate, date_of_birth.month(), date_of_birth.day() ) print( "\n %d years old on %s (%s)" % ( years_to_celebrate, date_to_celebrate, date_to_celebrate.get_day_of_week() ), end="" ) years_to_celebrate = years_to_celebrate + 10 print( "\n" )