Answer to Question #226571 in Python for umesh

Question #226571

Years, Weeks & Days

Given

N number of days as input, write a program to convert N number of days to years (Y), weeks (W) and days (D).Note: Take 1 year = 365 days. Input

The input contains single integer

N.Output

Print space-separated integers

Y, W and D.Explanation

Given

N = 1329. The value can be written as 1329 = 3 years + 33 weeks + 3 days So the output should be

3 33 3.

using basic python


1
Expert's answer
2021-08-16T05:48:41-0400


N = int(input("Enter No. of Days N: "))
Y = N//365
W = (N%365)//7
D = N - ((Y * 365) + (W*7))
print("%d = %d years + %d weeks + %d days."%(N,Y,W,D))
print("\n",Y,W,D)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS