write a python program to print the version of the python

Опубликовано: 12 Октябрь 2024
на канале: programmer aditya
10
0

The said code imports the "sys" module and then uses it to print the version of Python currently being used, as well as additional version information.

The first line imports the "sys" module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It is always available.
The second line prints the string "Python version".
The third line prints the version of Python currently being used to the console.
The fourth line prints the string "Version info.".
The fifth line prints version information of the current Python interpreter. It returns a named tuple (version_info) containing the five components of the version number: major, minor, micro, releaselevel, and serial.