write a python program to convert given number of days to a measure of time given in year,weeks and days.

 For Example:-      375 days is equal to 1 year 1 week and 3 days (ignore leap year)

code:-

no_day=int(input(“Enter number of days”))
year=0
week=0
days=0
if no_day>=365:
year=no_day//365
re_days=no_day-(year*365)
if re_days>=7:
week=re_days//7
days=re_days-(week*7)
print(“year=”,year,” weak=”,week,” days=”,days)

Output:-

Enter number of days375
year= 1 weak= 1 days= 3




Leave a Reply

Your email address will not be published.