⏱️
Your week in numbers
Turn a week of activities into a ranked chart with bars.
Maker· ages 12–1430 mindictssortedlambdaf-string formattingenumerate
week.py
…First load pulls ~10 MB of Python. Only happens once — the browser caches it after.
What should the output look like?
You should see a ranked list of your activities with a bar for each.
📖
How this works
A dict stores your hours per activity. sorted() with a key= function ranks them. enumerate() gives us the ranking positions, and f-string formatting lines everything up in neat columns.
Your turn — try these
- 1Add "hobbies" and "outside" to the week dict — do they change the ranking?
- 2Compute the % of "logged" hours in each category, then sort by % instead of raw hours.
- 3Print a warning if any activity is more than 25% of your week.