Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aba71cd

Browse files
Merge pull request avinashkranjan#2155 from idiotcommerce/patch-1
Update Age_Calculator.py @avinashkranjan
2 parents 36426bd + 912d663 commit aba71cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎Age_Calculator/Age_Calculator.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ def calculate_age(birthday):
99

1010
day_check = ((today.month, today.day) < (birthday.month, birthday.day))
1111
year_diff = today.year - birthday.year - day_check
12-
remaining_months = abs((12-birthday.month)+today.month)
12+
remaining_months = abs((12-birthday.month)+today.month)
1313
remaining_days = abs(today.day - birthday.day)
1414

15-
# Return the age as a formatted string
15+
# Return the age as a formatted string
1616
age_string = f"Age: {year_diff} years, {remaining_months} months, and {remaining_days} days"
1717
return age_string
1818

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /