Years, Weeks & Days
Given
The input contains single integer
Print space-separated integers
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
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)
Comments
Leave a comment