0

I am doing an assignment for an intro python class and do not know how to get age calculated using my birth date and the current date.

print("Hello, welcome to Hopper's Computer Museum! To determine your entrance fee, please enter the following:")
dob = int(input("Your Date of Birth (mm dd yyyy)-: "))
currentdate = int(input("Today's date (mm dd yyyy): "))

Any help on where to start from the code I have already would be fantastic. I do not know how to get an age calculated from using the input mm dd yyyy.

cs95
  • 379,657
  • 97
  • 704
  • 746
  • I did. All other age calculations would use import date, which I tried and does not work. I was simply trying to find an easier way to calculate age using the mm dd yyyy input. I can find age prompting them 6 different times with individual day month and year for current and dob but that is obviously a lot sloppier. – mynamedinkie Oct 04 '17 at 22:59

1 Answers1

0

Why don't you simply subtract the birth year with current date? You will get to know how many years you lived. If you want to know it accurately then the subtract the months and dates also.

cs95
  • 379,657
  • 97
  • 704
  • 746