Learning Python (Part 6): Writing Pythonic code
Comprehensions, slicing, enumerate, zip, unpacking, and truthiness: these idioms make our Python code more compact, clearer, and easier to read.
ls -lt posts/
Writing on systems, tooling and the occasional yak-shave.
Comprehensions, slicing, enumerate, zip, unpacking, and truthiness: these idioms make our Python code more compact, clearer, and easier to read.
Only available in German.
match/case ist mehr als ein switch: Mit Literal-, Sequenz-, Mapping- und Class-Patterns zerlegst Du Datenstrukturen, bindest Werte und ergänzt Bedingungen über Guards.
Functions break code into named, reusable blocks. With parameters, return values, and scope, our game loop becomes easy to follow again.
Only available in German.
Atembare Luft ist Priorität eins – und in geschlossenen Räumen können CO₂ und CO zu unsichtbaren Gefahren werden. Was Apollo 13 vorbildlich macht und was das für Zelt, Auto und Notunterkunft bedeutet.
Only available in German.
Ausrichtung, Präzision, Tausendertrenner, Debug-Syntax und dynamische Formatangaben – so nutzt Du die Format-Mini-Sprache der f-Strings vollständig aus.
Lists, tuples, dictionaries, and sets: with them, we describe the dungeon world as data and give our adventurer a real inventory.
Only available in German.
Vom Quelltext zum laufenden Programm: Tokenizer, AST, Code-Objekte, Bytecode und die CPython-Ausführungsengine – plus ein Blick auf Cache, Spezialisierung, Free-Threading und JIT.
Comparisons, conditions, and loops, plus a game loop that lets the dungeon respond to commands and change its state during play.
The survival series kicks off: the Rule of 3 puts acute threats in a sensible order, as long as you treat it as a memory aid and not a stopwatch.
Only available in German.
Die neue REPL seit Python 3.13, praktische eingebaute Funktionen sowie die Alternativen IPython und ptpython – die interaktive Shell kann weit mehr als nur rechnen.