codemaniacstudio

Write a Python program to convert days into years, weeks and days.

Write a Python program to convert days into years, weeks and days.

PROGRAM

# Python program to convert days into years, weeks, and days
# Input: Total number of days
total_days = int(input(“Enter total number of days: “))
# Calculate years, weeks, and remaining days
years = total_days // 365
remaining_days = total_days % 365
weeks = remaining_days // 7
days = remaining_days % 7
# Output the result
print(“Years:”, years)
print(“Weeks:”, weeks)
print(“Days:”, days)

OUTPUT

TRY THE ABOVE CODE

Exit mobile version