Start here in Python

The most useful guides in this topic, not just the most recent.

50+ Free Guides

Python Guides & Tutorials

Learn Python the right way — syntax, data structures, OOP, libraries, APIs and project ideas that build a hire-ready portfolio.

Python articles

Python
6 May 2026 7 min

Python Decorators Explained with Real Examples

Decorators demystified: what the @ line actually does, why functools.wraps matters, and five decorators worth writing or knowing, from a timer and a configurable retry to functools.cache, a registry that collects plugins, and a permission check, plus the order in which stacked decorators run.

GloryTecks Team
Read
Python
6 May 2026 6 min

Python Decorators vs Context Managers: When to Use Each

Decorators wrap a whole function; context managers wrap a block of code. How each one works, a transaction that rolls back on error, a single timer usable as both a decorator and a with statement, suppress and ExitStack from contextlib, and a clear rule for choosing between them.

GloryTecks Team
Read
Python
6 May 2026 6 min

Python f-Strings: Formatting Done Right

A practical tour of what goes after the colon in a Python f-string: alignment and width, thousands separators, decimal places and percentages, signs and padding, dates and times, repr and the = debugging specifier, nested specs for dynamic widths, and building aligned text tables.

GloryTecks Team
Read
Python
6 May 2026 7 min

Python Generators and Iterators Made Simple

How iteration really works in Python, from the protocol behind every for loop to generator functions with yield: building lazy pipelines that process a file of any size in constant memory, delegating with yield from, the itertools functions worth knowing, and the one-shot behaviour that surprises everyone once.

GloryTecks Team
Read
Python
6 May 2026 6 min

Python Iterators vs Generators vs Comprehensions

The same task written as an iterator class, a generator function, a generator expression and a list comprehension, then measured for time and peak memory. The numbers show why lists cost memory, why generators do not, when a class is worth its extra code, and how to choose between the four.

GloryTecks Team
Read
Python
6 May 2026 6 min

Python Lists vs Tuples vs Sets vs Dictionaries

Python's four core collections compared on the properties that decide which to use: order, duplicates, mutability, whether they can be dictionary keys, how fast membership tests are and how much memory they take, with runnable demonstrations and a short set of questions that picks the right one.

GloryTecks Team
Read