Python quick reference

Runs in Zerethon IDE · Python 3.12 Official Python documentation ↗

Python 3.12 essentials: values and types, control flow, functions, lists and dicts, strings, input and files — and how a Python program runs in Zerethon IDE.

Written for Python 3.12. Examples that show an output were run in the Zerethon sandbox (Python 3.12) on 2026-10-20.

Basics

  • Hello, World

    The smallest Python program, and how print() writes output.

  • Variables and types

    Names, numbers, strings, booleans, None, and converting between types.

  • Conditions and loops

    if / elif / else, for over a range or a collection, while, break and continue.

  • Functions

    Define functions with def, default and keyword arguments, return values, and the if __name__ == "__main__" guard.

Data

  • Lists, dicts, sets and tuples

    The four built-in collections, sorting, and list comprehensions.

  • Strings

    f-strings, common string methods, splitting and joining, and regular expressions with re.

Input and files

In Zerethon IDE

  • Running Python in Zerethon IDE

    What Run does with your project, the time limit, input, tests, and what a run cannot do.

  • Common errors

    What NameError, IndentationError, TypeError, IndexError, KeyError and EOFError mean and how to fix them.

  • Official documentation

    Where to read more: the Python tutorial, the library reference and the language reference.

References