python-basics

Python fundamentals for beginners: variables, data types, operators, control flow, and functions, the core syntax every Python program is built on.

Python: Debugging & Basic Testing with pdb, breakpoint(), assert

Some bugs announce themselves with a loud crash, while the sneakier ones just hand you the wrong answer and let you ship it. Python debugging is how you hunt down both kinds on purpose, and the good news is it comes down to a few small tools you can pick up in an afternoon. This post covers pdb, breakpoint(), and assert, the debugger commands worth memorising, and a calm, repeatable process for finding and fixing bugs. “Debugging is twice as ... Read More

Python: Working with CSV and JSON Files

Sooner or later every script produces data worth keeping: a class list, an API response, a config file. Python CSV JSON support is built in for exactly that moment, with csv for spreadsheet-style rows and json for nested data. No pip install, just an import. This post covers reading and writing both formats, then converting between them. “Data is a precious thing and will last longer than the systems themselves.” Tim Berners-Lee Last Updated: July 2026 | Tested on: Python ... Read More

Python: Exception Handling, Reading Tracebacks & try/except/else/finally

Your program is humming along, then someone types letters where you expected a number and it dies on the spot. Moments like that are exactly what python exception handling is for. Rather than letting one bad value take down everything, you catch the error, decide how to respond, and keep the program alive. This post covers try, except, else, and finally, plus how to read a traceback, all with tested examples on Python 3.14.6. “Errors should never pass silently. Unless ... Read More