example-projects/reference/python
2026-05-28 12:16:02 -05:00
..
01_hello_world.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
02_variables.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
03_datatypes.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
04_conditionals.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
05_loops.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
06_functions.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
07_lists_and_dicts.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
08_classes.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
09_error_handling.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
10_file_io.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
11_putting_it_together.py Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
installing-python.md Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00
README.md Syncing from Shen's latest main on github 2026-05-28 12:16:02 -05:00

Python — reference material

This folder is a self-paced Python primer. It is not the spine of the class — your project is. We've put it here because some projects will need a working understanding of Python (or another language), and when that comes up it's useful to have something concrete to point at.

When to dip in

  • Your project genuinely needs you to read or modify Python code, and AI explanations alone aren't sticking.
  • You're curious how the code AI generates for you actually works.
  • You want a foundation so you can steer AI more confidently.

When not to dip in

  • Out of a sense of obligation. There's no test. Nobody is going to ask if you finished 08_classes.py.
  • Before you have a problem to apply it to. These lessons are dense if you're reading them in the abstract; they click much faster when you have a concrete reason to care.

How to run a script

All scripts are standalone. From this folder:

python3 01_hello_world.py

(Use python instead of python3 on Windows if that's what your install named.)

Lessons

Work in order if you're starting from zero. Skip around if you already know parts of this.

File Topic
01_hello_world.py print() — your first program
02_variables.py Variables, f-strings
03_datatypes.py int, float, str, bool, None; type conversion
04_conditionals.py if, elif, else; comparisons; logical operators
05_loops.py for, while, break, continue, range()
06_functions.py Defining and calling functions; parameters; return values
07_lists_and_dicts.py Core data structures; list comprehensions
08_classes.py Objects, attributes, methods, inheritance
09_error_handling.py try/except; raising exceptions
10_file_io.py Reading and writing text and CSV files
11_putting_it_together.py A complete CLI program combining everything

If Python isn't installed yet, see installing-python.md.