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 7bc3acd

Browse files
Merge pull request avinashkranjan#2278 from avinashkranjan/deepsource-transform-a49c12a6
format code with autopep8
2 parents 4e295fc + 78598f1 commit 7bc3acd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎Age_Calculator/Age_Calculator.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from datetime import date
22

3+
34
def calculate_age(birthday):
45
today = date.today()
56

@@ -12,10 +13,11 @@ def calculate_age(birthday):
1213
remaining_months = abs((12-birthday.month)+today.month)
1314
remaining_days = abs(today.day - birthday.day)
1415

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

20+
1921
if __name__ == "__main__":
2022
print(" Age Calculator By Python")
2123

0 commit comments

Comments
(0)

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