Advent of Python 2026Day 2 is out →

    Day 14Christmas Countdown

    Ho ho ho! Day 1 of 25 is open. A gentle warm-up to get your fingers going. No hints, no AI: you've got this!

    Write countdown(day) that takes a day of December (1 to 31) and returns a message.

    Before the 25th, return "N days to go!", where N is the number of days left until the 25th. On the 25th itself, return "Merry Christmas!". After the 25th, return "See you next year!".

    Examples

    Example 1
    >>> countdown(1)
    '24 days to go!'
    Example 2
    >>> countdown(24)
    '1 day to go!'
    Example 3
    >>> countdown(25)
    'Merry Christmas!'

    Good to know

    • With exactly one day left, write "1 day to go!" (day, not days).

    Check tests your code on the 3 examples above. Submit runs all 6 tests, including hidden edge cases, and marks the challenge solved.

    solution.py
    Loading Python…

    Test results show up here

    Write countdown in the editor, then press Check. Use print() freely: its output is shown for each test.