Core Concepts

One concept per article: data structures, syntax, built-ins, and common patterns. No long tutorials—just clear, focused explanations.

Once you know how to write basic Python—variables, data types, functions, and loops—you will keep running into the same ideas: when to use a list vs a tuple, what *args and **kwargs mean, how list comprehensions and decorators work, and why == and is behave differently. This section is a reference for those concepts: one article per topic, with short explanations and runnable examples.

We group topics roughly by theme. Data structures and types: lists vs tuples, mutable vs immutable, dictionaries, sets, slicing, and shallow vs deep copy. Functions and control flow: lambda, default arguments, return values, map and filter, decorators, and closures. Iteration and built-ins: enumerate, zip, range, generators, iterators and iterables. Strings and formatting: string methods, f-strings, and string formatting. Errors and context: exception handling and context managers.

Use the sidebar or the list below to jump to a concept. If you hit an error you do not recognise, check the Errors & Exceptions section; many messages become clear once you understand the underlying concept (for example NoneType has no len() after reading about return values and None)