Object-Oriented Programming (OOP) in Python
Classes, objects, inheritance and the dunder methods that make Python objects feel built in — plus dataclasses and when a function is…
Try: python lists, javascript functions, syntax error, first project
Plain-English Python guides, from installing it to writing small programs that do real work. Short examples you can copy, run and change.
56 guides
Classes, objects, inheritance and the dunder methods that make Python objects feel built in — plus dataclasses and when a function is…
IPython is missing from the interpreter you are running. Here is the fix, including the capitalisation trap and the Jupyter kernel mismatch…
== asks whether two values are equal; is asks whether they are the same object. Use is only for None, True, False…
You put call brackets after something that is not a function. The type in the message names it. The usual cause is…
You used square brackets on something that does not support them: an int, a None, a function, a method you forgot to…
Installed Python 3.14 and now pip is missing, points at the old version, or fails to install packages? The three causes, the…
Four ways to import a module from a parent folder, why sys.path.append is the worst of them, and the editable install that…
Convert a dict to YAML with PyYAML, control the formatting, handle nested data and Unicode, and load YAML back safely.
This SyntaxError means a quote was opened and never closed. Here are the five causes — including the backslash trap on Windows…
The modules that come with Python and are worth knowing: pathlib, json, csv, datetime, collections, itertools, re, argparse and more, each with…
This means Python was built without the LZMA compression library. Here is how to fix it on Linux, macOS and with pyenv,…
Four ways to strip punctuation from a string in Python, which is fastest, and how to handle apostrophes, hyphens and non-English text…
Related topics
The fastest way to improve is to read one guide, then build the thing it describes. Start with the basics, or jump straight to a project.