python check version in code code example
Example 1: get python version in code
import platform
print(platform.python_version())
Example 2: python check version
python --version
import platform
print(platform.python_version())
python --version