Python Program to Convert Days to Year, Month and Weeks
Write Python Program to Convert Days to Year, Month and Weeks
# Python Program to Convert Days to Year, Month and Weeks days = int(input("Enter Days :--> ")) d = days year = int(days / 365) days = int(days % 365) month = int(days / 30) days = int(days % 30) week = int(days / 7) days = int(days % 7) print(d, " Days = ", year," Year, ", month, " Month, ", week, " Week and ", days, " days")
Output:
Enter Days :--> 438
438 Days = 1 Year, 2 Month, 1 Week and 6 days