Learning Python (Part 1): Installation and your first program
Install Python, try out the interactive REPL, and run your very first script: the start of our little text adventure.
ls -lt posts/
Python from scratch, for technically savvy readers who don't program yet. No hand-holding, but an honest start from zero. Over 11 parts, you build a runnable, modular mini game around a growing text adventure and learn everything from your first `print` to classes, error handling, and a clean project structure.
Install Python, try out the interactive REPL, and run your very first script: the start of our little text adventure.
Data types, variables, arithmetic, and f-strings: our adventurer gets hit points and gold, and the dungeon gets a proper status line.
Comparisons, conditions, and loops, plus a game loop that lets the dungeon respond to commands and change its state during play.
Lists, tuples, dictionaries, and sets: with them, we describe the dungeon world as data and give our adventurer a real inventory.
Functions break code into named, reusable blocks. With parameters, return values, and scope, our game loop becomes easy to follow again.
Comprehensions, slicing, enumerate, zip, unpacking, and truthiness: these idioms make our Python code more compact, clearer, and easier to read.
Classes bundle state and behavior: players, rooms, and items become objects with their own attributes and methods.
Only available in German.
Exceptions verstehen und gezielt behandeln: try, except, else, finally, eigene Fehlerklassen und EAFP – damit der Dungeon auf ungültigen Input reagiert, statt abzustürzen.
Only available in German.
Dateien lesen und schreiben mit with, pathlib und JSON – damit der Dungeon seinen Spielstand speichern und später wiederherstellen kann.
Only available in German.
Code auf mehrere Dateien aufteilen: eigene Module, import, der __main__-Block, klare Verantwortlichkeiten – plus ein erster Einstieg in venv und pip.