check python version from a script code example
Example 1: check python version
# To check Python version
python -V
----or----
python --version
Example 2: get python version in code
import platform
print(platform.python_version())
# To check Python version
python -V
----or----
python --version
import platform
print(platform.python_version())