We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aba71cd commit 78598f1Copy full SHA for 78598f1
Age_Calculator/Age_Calculator.py
@@ -1,5 +1,6 @@
1
from datetime import date
2
3
+
4
def calculate_age(birthday):
5
today = date.today()
6
@@ -12,10 +13,11 @@ def calculate_age(birthday):
12
13
remaining_months = abs((12-birthday.month)+today.month)
14
remaining_days = abs(today.day - birthday.day)
15
- # Return the age as a formatted string
16
+ # Return the age as a formatted string
17
age_string = f"Age: {year_diff} years, {remaining_months} months, and {remaining_days} days"
18
return age_string
19
20
21
if __name__ == "__main__":
22
print(" Age Calculator By Python")
23
0 commit comments