Check Python Version in Your Script — A Helpful Illustrated Guide

To check your version in your Python script—for example, to make sure that a user of your Python app uses the correct version—you can use the following commands. To achieve this, simply import the sys module and print the sys.version attribute to your Python shell:

>>> import sys
>>> print(sys.version)
3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)]

Try them in our interactive browser-based Python shell:

Exercise: execute this code snippet and see what Python version runs on the servers hosting this interactive shell.

Related: You can find a detailed tutorial on how to check your Python version in this comprehensive guide on the Finxter blog. If you’re short on time, here’s what you must run in your command line or shell or terminal (Win/Mac/Linux/Ubuntu) to check your python version: python --version or python -V.

Where to Go From Here?

Enough theory. Let’s get some practice!

Coders get paid six figures and more because they can solve problems more effectively using machine intelligence and automation.

To become more successful in coding, solve more real problems for real people. That’s how you polish the skills you really need in practice. After all, what’s the use of learning theory that nobody ever needs?

You build high-value coding skills by working on practical coding projects!

Do you want to stop learning with toy projects and focus on practical code projects that earn you money and solve real problems for people?

🚀 If your answer is YES!, consider becoming a Python freelance developer! It’s the best way of approaching the task of improving your Python skills—even if you are a complete beginner.

If you just want to learn about the freelancing opportunity, feel free to watch my free webinar “How to Build Your High-Income Skill Python” and learn how I grew my coding business online and how you can, too—from the comfort of your own home.

Join the free webinar now!