Back

Explore Courses Blog Tutorials Interview Questions
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 (106k 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.2k points)
0 votes
1 answer
asked Dec 2, 2020 in Python by laddulakshana (12.7k points)
0 votes
1 answer
asked Jul 10, 2019 in Python by Sammy (47.6k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.2k users

Browse Categories

...