How do you check what version of Python is running your script?

If you want to check you python version that running you script. You can use sys.version

import system

The output

3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]

use sys.version_info to know more

The output

sys.version_info(major=3, minor=9, micro=0, releaselevel='final', serial=0)