Skip to content
Hi, Bot

Hi, Bot · First Principles · Phase 1: Logic, functions, symbols

Lesson 8 of 48

Python: files and automation

Make the machine do something tedious that you actually have to do.

The moment a script saves you real time, programming stops being homework. It is also the first time your code meets data you did not invent — messy, inconsistent, and the only kind that exists outside a textbook.

Do this

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.

The question that unlocks the next lesson

Why is reading a real file from your own machine a better exercise than a prepared example?

  • AReal files are larger, so the script runs faster
  • BReal data is messy and inconsistent, which is the case your code must actually survive
  • CPrepared examples cannot be opened in Python
  • DIt avoids having to handle errors

Start at lesson 1 and work up to this one

48 lessons, one a day. Answer each lesson's question correctly and the next one opens immediately — nothing here is unlocked by waiting.

By submitting, you agree to our Terms and Privacy Policy.