Given
N number of days as input, write a program to convert N number of days to years (Y), weeks (W) and days (D).
solution
N = int(input("Enter an interger for the number of days : "))
Y = N//365
W = (N%365)//7
D = N - ((Y * 365) + (W*7))
print(N, "days =", Y, "years,", W, "weeks and", D,"days")
Comments
Leave a comment