Answer to Question #273925 in Python for balu

Question #273925

given a number of days(N) as input,write a program to convrt N to years(Y),weeks(W),and days(D).


1
Expert's answer
2021-12-01T10:57:21-0500
n = int(input('Enter number: '))
y, n = divmod(n, 365)
w, n = divmod(n, 7)
print(f'Years: {y}')
print(f'Weeks: {w}')
print(f'Days: {n}')

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