Answer to Question #233569 in Python for vijay

Question #233569
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.

Sample Input 1
1329
Sample Output 1
3
33
3
Sample Input 2
0
Sample Output 2
0
0
0
1
Expert's answer
2021-09-06T00:16:32-0400
N = int(input())
Y = N//365
W = (N%365)//7
D = N - ((Y * 365) + (W*7))
print(Y)
print(W)
print(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