Skip to Content

Python Basics: How Can You Reliably Check Your Installed Python Version from the Command Line?

What Command Displays the Active Python Interpreter Version on Most Systems?

Learn the standard command to display your installed Python version directly from the terminal. Using python –version is the most reliable method across Windows, macOS, and Linux to confirm which Python interpreter is currently active in your environment.

Question

Which command reliably displays your installed Python version on most systems?

A. python -modules
B. python –version
C. pip –version
D. py –registry

Answer

B. python –version

Explanation

This prints the active Python interpreter’s version.

When you execute python –version in your terminal or command prompt, you are invoking the Python executable with the –version flag. This flag instructs the program to output its version information to the console and then exit, rather than starting an interactive session. This command is a standardized feature and works consistently across most operating systems, including Windows, macOS, and Linux, making it the most dependable way to check your Python version. You can also use the shorthand -V (capital V), as in python -V, to achieve the same result.

The other options are incorrect for the following reasons:

  • python -modules is not a valid command or flag in Python.
  • pip –version checks the version of pip, which is the package installer for Python. While pip is installed with Python, it is a separate tool with its own version number. This command does not display the version of the Python interpreter itself.
  • py –registry is not a standard command. While py is the Python Launcher for Windows, the –registry argument is not a valid flag for checking the version.

Python Basics: Learn, Apply & Build Programs certification exam assessment practice question and answer (Q&A) dump including multiple choice questions (MCQ) and objective type questions, with detail explanation and reference available free, helpful to pass the Python Basics: Learn, Apply & Build Programs exam and earn Python Basics: Learn, Apply & Build Programs certificate.