Rung 8
Python: files and automation
Make the machine do something tedious that you actually have to do.
Best attempted after 7. Python: syntax and types. Nothing stops you trying this now — the gate will tell you if you were right.
The gate
Write a script that reads a real file from your own machine — not a toy example — and reports something true about it that you did not already know. Run it twice on different files without editing the code.
Nobody checks this but you. Do it honestly and the rungs above hold; do it loosely and they will not, somewhere further up where the cause is much harder to find.
Up to now your programs have talked only to you. A program that reads a file is a program that can touch the world — and the moment it does, the world turns out to be much messier than the examples.
Why this is on the ladder
Two reasons, both practical.
First, every dataset you will ever train anything on arrives as a file, and it arrives dirty: missing values, inconsistent formats, a stray header, text where you expected numbers. Rung 45 will not fail because your maths was wrong. It will fail because row 4,812 had an empty field.
Second, this is the first rung where the machine does something for you. That is worth feeling. Pick a task you genuinely resent doing by hand.
Do this
Find real tedium in your own life: renaming a folder of files, pulling totals out of a spreadsheet export, counting how often something appears in a log, checking which of two lists has entries the other lacks.
Write the script. Then, and this is the actual gate, run it on a second file you did not have in mind when you wrote it. Whatever breaks is an assumption you baked in without noticing — that the file had a header, that every line had the same number of fields, that nothing was blank.
Fix it so both files work with no code change.
Where people get stuck
Encoding and line endings cause failures that look like nonsense. When a file opens fine in an editor but explodes in Python, suspect the encoding before you suspect your logic.
The deeper trap is writing a script that works on exactly one file. That is not automation, it is a very slow way of doing the task once. The second file is what turns it into a tool — and noticing the difference is the whole rung.