7. Simple statements — Python 3.14.7 documentation

docs.python.org

Tin mới

8. Compound statements

Python Module Index

3.14.7 Documentation

The Python Language Reference

starred_expression

Expression statements are used (mostly interactively) to compute and write a value, or (usually) to call a procedure (a function that returns no meaningful result; in Python, procedures return the value None). Other uses

7.1. Expression statements¶

Expression statements are used (mostly interactively) to compute and write a value, or (usually) to call a procedure (a function that returns no meaningful result; in Python, procedures return the value None). Other uses

7.2. Assignment statements¶

Assignment statements are used to (re)bind names to values and to modify attributes or items of mutable objects:

The standard type hierarchy

Assignment statements are used to (re)bind names to values and to modify attributes or items of mutable objects:

7.2.2. Annotated assignment statements¶

Annotation assignment is the combination, in a single statement, of a variable or attribute annotation and an optional assignment statement:

7.2.2. Annotated assignment statements¶

Annotation assignment is the combination, in a single statement, of a variable or attribute annotation and an optional assignment statement:

annotationlib: Functionality for introspecting annotations

Annotation assignment is the combination, in a single statement, of a variable or attribute annotation and an optional assignment statement:

typing: Support for type hints (see :pep:`484`).

The proposal that added the typing module to provide a standard syntax for type annotations that can be used in static analysis tools and IDEs.

7.3. The assert statement¶

Assert statements are a convenient way to insert debugging assertions into a program:

7.3. The assert statement¶

Assert statements are a convenient way to insert debugging assertions into a program:

7.3. The assert statement¶

Assert statements are a convenient way to insert debugging assertions into a program:

7.11. The import statement¶

The basic import statement (no from clause) is executed in two steps:

importlib.import_module()

The basic import statement (no from clause) is executed in two steps:

7.11. The import statement¶

The basic import statement (no from clause) is executed in two steps:

__future__: Future statement definitions

A future statement is a directive to the compiler that a particular module should be compiled using syntax or semantics that will be available in a specified future release of Python where the feature becomes standard.