banner



How To Check Python In Windows

Cheque the Version of the Python Interpreter

Better Article

Salve Article

Like Article

Nether this article, nosotros will get to know the current version of python interpreter in the system. Getting the version of the interpreter is actually important equally the python interpreter is widely used throughout the industries for figurer programming and source coding. Information technology takes an interactive command and executes information technology.

As the interpreter is the one which takes the code and helps in execution. Sometimes due to the old version of the interpreter making command doesn't work properly and as we know the language python comes with frequent update vision with some added new features, so the user must update the interpreter with the latest release version.

To get the Version of the python Interpreter; They are listed as follows:

  • Using sys.version method
  • Using python_version() function
  • Using python -V command

1. Using sys.version method:

For this method, the user needs to import the sys library and from sys.version command which volition return the user'southward current python version in the use. For this method, the user must open the Python beat and write the following control equally given beneath, with this command the user will get the current working version of the python interpreter in the course of a string.

Here are some step that user must follow to become its current running version of the python interpreter:-

  1. Open cmd/terminal/windows powershell
  2. Write 'python' and press enter key to move into python interpreter
  3. Write the same command given in the input box below, and in the result, the user volition get the current interpreter version.

Python3

import sys

print ( "User Current Version:-" , sys.version)

Output:

2. Using python_version() part:

This function is accessible by importing the platform library and will e'er return a string of the running user's python version. For better understanding one can become with the post-obit steps:-

  1. Open up cmd/last/windows powershell
  2. Write 'python' and press enter primal to motility into python interpreter
  3. Now, write the aforementioned command as mention below in the lawmaking box given, and press enter , with this it will return the current python interpreter version in the form of string.

Python3

from platform import python_version

print ( "Current Python Version-" , python_version())

Output:

3.Using  python -V command:-

This method is i of the simplest methods amongst all other methods as in this method user get the electric current python version with the one of the inbuilt command present in python.

Here are some pace that user must follow to get its electric current running version of the python interpreter:-

  1. Open up cmd/terminal/windows powershell
  2. Now, write the aforementioned control equally mention below in the code box given, and printing enter , with this it will return the electric current python interpreter version in the course of string.
            python -V

Output:


Source: https://www.geeksforgeeks.org/check-the-version-of-the-python-interpreter/

Posted by: beaverdonsinout.blogspot.com

0 Response to "How To Check Python In Windows"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel