Pages

Topics

Tools

↑↓navigate↵openescclose

Python guides

Every published Python guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Python guides

Editorial illustration showing a short text string repeated multiple times using the multiplication operator in Python
Python

Python String Repetition with the * Operator

python string repetition: How the * operator repeats strings in Python, covering multiplier edge cases, practical uses, memory cost, and when join or format is better.

pythonstring manipulationpython operatorsstring methods
Illustration of a short text string being repeated into a longer sequence by a multiplication-like visual, showing the concept of string repetition in Python.
Python

Python String Multiplication: Syntax and Behavior

Learn how Python string multiplication works with the * operator, including syntax, edge cases, practical use cases, and memory behavior.

pythonstring-operationspython-syntaxmemory-usage
Diagram comparing Python string concatenation methods with the plus operator, join, and f-strings showing allocation behavior
Python

Python String Concatenation: Choosing the Right Approach

python string concatenation: Compare Python string concatenation approaches—+, join(), and f-strings—and learn which to use for readability, performance, and maintaina...

string concatenationf-stringsjoin methodPython performance
Illustration of Python f-string debug syntax showing a variable name and its value connected by an equals sign.
Python

Python f-string debug syntax: using = for variable inspection

Use Python's f-string `=` debug syntax to print variable names and values together. This guide covers expressions, format specifiers, conversion flags, pitfalls, and Python 3.8+ compatibility.

f-stringdebuggingpython-3.8string-formatting
Illustration of Python f-string expression showing variable interpolation and format specifiers.
Python

Python f-string Expressions: Syntax, Evaluation, and Pitfalls

Learn how Python f-string expressions work: syntax, evaluation, format specifiers, the `=` debugging shortcut, and common pitfalls.

f-stringsstring formattingPython syntaxexpression evaluation
Python f-string formatting code snippet with curly braces and format specifiers on a dark editor background.
Python

Python f-String Formatting: Syntax and Specifiers

python f string formatting: Learn Python f-string formatting: expression syntax, format specifiers, nested usage, and practical pitfalls for cleaner string interpolation.

f-stringsstring formattingPython syntaxformat specifiers
Python f-string syntax with curly braces and a formatted output example.
Python

Python F-String Usage: Syntax, Formatting, and Debugging

Learn how to use Python f-strings for clean string interpolation, formatting values, and debugging expressions with practical examples.

f-stringsstring formattingPython syntaxdebugging
Diagram showing an f-string with embedded variables and format specifiers in Python code.
Python

Python Formatted String Literals: Syntax and Usage

python formatted string literal: Understand Python formatted string literals (f-strings): syntax, expressions, format specifiers, performance, and common pitfalls for...

f-stringsstring formattingPython syntaxPython 3
Python f-string syntax with curly braces and a formatted value
Python

Python f-Strings: Syntax, Formatting, and Pitfalls

python f string: Learn how Python f-strings work: expression embedding, format specifiers, debugging with =, nesting, performance, and common compatibility pitfalls.

f-stringsstring formattingPython 3debugging
Diagram showing a Python raw string literal with backslashes treated as literal characters
Python

Python Raw String Literals: Syntax and Use Cases

python raw string literal: Learn how Python raw string literals treat backslashes literally, and when to use them for regex patterns, file paths, and other backslash-h...

PythonRaw StringsRegular ExpressionsEscape Sequences