How do I check which version of python is runnning my script?

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:
- Use the
python_version
library:
>>> from platform import python_version
>>> print(python_version())
2. use the sys
library:
>>> import sys
>>> print(sys.version)