There are two environment in which you can check your python version.

Check the Python version on the command line:

python --version

In short,

python -V

Check the Python version in script at run time:

  1. Use the python_version library:
>>> from platform import python_version
>>> print(python_version())

2. use the sys library:

>>> import sys
>>> print(sys.version)