all Python 3platformfunction
platform.version()
system and machine
The detailed OS release version as a string, e.g. '#1 SMP PREEMPT_DYNAMIC …' on Linux or '10.0.22631' on Windows.
Syntax
platform.version()
Do not confuse it with python_version(): this one is about the operating system, not Python. On Linux the string describes the kernel build (number, flags, date) and means little to a person; on Windows it holds the build number that tells Windows 11 from Windows 10 (builds from 22000 up).
Examples
import platform
print(platform.version()) # → ? например #1 SMP PREEMPT_DYNAMIC или 10.0.22631
print(platform.version() == platform.uname().version) # → True
See also
Open in the full glossarydocs.python.orgReport an inaccuracy