Categories
Python Answers

How to check what version of Python is running a script?

Spread the love

Sometimes, we want to check what version of Python is running a script.

In this article, we’ll look at how to check what version of Python is running a script.

How to check what version of Python is running a script?

To check what version of Python is running a script, we can use the sys.version property.

For instance, we write

import sys

print(sys.version)

to print the version out by using sys.version.

Conclusion

To check what version of Python is running a script, we can use the sys.version property.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *