Python Glossary Русский

all Python 3systerm

sys.version

information

A string with the interpreter version and build details. Compare versions with sys.version_info.

Syntax

sys.version
sys.version_info >= (3, 10)

sys.version is not meant to be parsed or compared: as strings '3.10' < '3.9'. Checks use the tuple sys.version_info, compared with a tuple: sys.version_info >= (3, 10). Its major, minor and micro fields are also available by name.

Examples

import sys
print(sys.version)  # → ? например 3.14.0 (main, Oct  7 2025, ...)
print(sys.version_info >= (3, 8))  # → True
print('3.10' < '3.9', (3, 10) < (3, 9))  # → True False — строки сравнивают посимвольно

See also

Open in the full glossarydocs.python.orgReport an inaccuracy