Private
Public Access
1
0

passing tests - saving goldmedal score

This commit is contained in:
Sander Roosendaal
2020-12-05 13:31:02 +01:00
parent 473198b88b
commit 1dd0c0cff9
2 changed files with 8 additions and 2 deletions

View File

@@ -327,7 +327,10 @@ def calculate_age(born,today=None):
if not today:
today = date.today()
if born:
return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
try:
return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
except AttributeError:
return None
else:
return None