Skip to content

Commit 047c63c

Browse files
committed
Your life in weeks calculator Complete
1 parent 7d64858 commit 047c63c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: life_in_weeks.py

+10
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,14 @@
77
# convert input string to int value
88
age_in_int = int(age)
99

10+
# Calculation for years,months,weeks and days
11+
years_remaining = 90 - age_in_int
12+
days_remaining = years_remaining * 365
13+
weeks_remaining = years_remaining * 52
14+
months_remaining = years_remaining * 12
1015

16+
# Printing the result
17+
18+
message = f"You have {days_remaining} days, {weeks_remaining} weeks, and {months_remaining} months left"
19+
20+
print(message)

0 commit comments

Comments
 (0)