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

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.