see version of python linux is using code example
Example 1: get python version in code
import platform
print(platform.python_version())
Example 2: check python version kali linux
$ python2 --version
import platform
print(platform.python_version())
$ python2 --version