xxxxxxxxxx
import sys
if not sys.version_info.major == 3 and sys.version_info.minor >= 6:
print("Python 3.6 or higher is required.")
print("You are using Python {}.{}.".format(sys.version_info.major, sys.version_info.minor))
sys.exit(1)
xxxxxxxxxx
# To check your Python version in the command line use:
python --version
# To check your Python verson inside a script use:
import sys
print(sys.version)
xxxxxxxxxx
# 2 ways to check python version
# In the terminal/cmd write the following:
# Way 1
python -V
# Way 2
python -c "import sys; print(sys.version)"
xxxxxxxxxx
python --versrion
print(sys.version_info)
# sys.version_info(major=3, minor=8, micro=3, releaselevel='final', serial=0)
import platform
print(platform.python_version())
import sys
print(sys.version)