My code works fine. I am just calculating how many days old a person is. However my method for converting the user input into usable information is very tedious.
Is there a way to prompt the user only once and then extract the needed info in a much easier way?
from datetime import datetime from datetime import date from datetime import time birth= raw_input("Birthday mm/dd/yyyy") month = str(birth)+str(birth) month=int(month) day=str(birth)+str(birth) day=int(day) year=str(birth)+str(birth)+str(birth)+str(birth) year=int(year) today=date.today() birthday=date(year,month,day) print((today-birthday).days)