To check what version of the Python interpreter is using to execute code, you can use the “version_info” command from the “sys” module:
1 2 3 4 |
import sys print(sys.version_info) # sys.version_info(major=3, minor=5, micro=2, releaselevel='final', serial=0) |
In this example the Python version 3.5.2. is using.