How do I check what version of Python is running my script?

You can use Python sys module to check what version of Python is running your script as shown in the below example –