LearnPy Hub
← Modules & the Standard Library problems
Medium

Age in Whole Years

Read a birth date and today's date as YYYY-MM-DD. Print the age in whole years (not yet a year older if the birthday hasn't come this year), using datetime.date.

Input

Two dates.

Output

One integer.

Sample 1

Input
2010-05-20
2026-11-14
Output
16

Sample 2

Input
2010-12-01
2026-11-14
Output
15
solution.py
Output appears here
Age in Whole Years · Python practice problem · LearnPy Hub