Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Python

Knowledge base — Python

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 583

Python

Quoted forward-reference annotations

An annotation such as "Node" describes a type using a name stored as text, even when the class is defined later. Python 3.14 defers annotation evaluation by default, so quotes are often no longer necessary, but remain valid syntax.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Formatted string literals

An f-string evaluates replacement fields at runtime and inserts their formatted values into text.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Raw string literal

The r prefix in r'...' preserves backslashes instead of interpreting escape sequences such as \n. The result remains an ordinary str object.

Basic · Python 3.14; repository image, production runtime not attested
Python

Type unions: X | Y and X | None

In type annotations, the union X | Y means a value of type X or Y, while the union X | None also permits None. Annotations describe allowed values but do not automatically enforce runtime checks.

Basic · Python 3.14; repository image, production runtime not attested
Python

Unpacking targets and call arguments

Assignment unpacking binds items from an iterable to targets, while call unpacking supplies separate arguments to a function.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Variadic parameters: *args and **kwargs

The *args parameter collects excess positional arguments into a tuple, while **kwargs collects excess keyword arguments into a dictionary. They let a function accept a variable number of arguments.

Basic · Python 3.14; repository image, production runtime not attested
Python

NoneType

The type of the singleton None is available as types.NoneType and also via type(None).

Intermediate · Python 3.14; repository image, production runtime not attested