Let’s see on how to check Python version currently installed.
Python version check
The are various ways to check a version of Python which is running. I’ll show you the easiest way.
import platform python_version = platform.python_version() print(python_version)
Now you can see that my Python version is 3.9.9.
You can use python_version variable to ask user for Python upgrade or to show any other info further in the script.