We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1f9593 commit f68bb42Copy full SHA for f68bb42
excercise_5.py
@@ -0,0 +1,11 @@
1
+"""Wap to find out how many days,month,
2
+ weeks we have left-
3
+ if we live until 90 years old"""
4
+age = int(input("Enter age:")) # Take age as input from the user
5
+years_left = 90 - age # Calculate years left until age 90
6
+days_left = years_left * 365 # Approximate days left (ignoring leap years)
7
+months_left = years_left * 12 # Approximate months left
8
+weeks_left = years_left * 52 # Approximate weeks left
9
+
10
+# Print the result using f-string formatting
11
+print(f"{years_left} Years {months_left} months {days_left} days {weeks_left} weeks")
0 commit comments