0 votes
1 view
in Python by (19k points)

How can I print the version number of the current Python installation from my script?

1 Answer

0 votes
by (107k points)

For printing the version number of the current Python installation you can use the following piece of code:-

This code will return the version information string.

import sys

print(sys.version)

image 

If you only want the version number then you can use the following piece of code:-

import platform

print(platform.python_version())

image

Related questions

0 votes
1 answer
asked Dec 30, 2020 in Python by ashely (50.5k points)
0 votes
1 answer
asked Dec 2, 2020 in Python by laddulakshana (12.5k points)
0 votes
1 answer
asked Jul 10, 2019 in Python by Sammy (47.8k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...