Days to Years, Months, Days Dry Run in PYTHON

Days to Years, Months, Days is an interactive PYTHON dry run visualizer from the Io programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Days to Years, Months, Days Program Code

# Convert days to years, months, days
days = int(input("Enter number of days: "))

years = days // 365
remaining_days = days % 365
months = remaining_days // 30
days_remaining = remaining_days % 30

print(f"{days} days = {years} years, {months} months, {days_remaining} days")

View the complete Io programs page.

Program Console Days to Years, Months, Days Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.