Get Python version of your System
How do you get the version information of your Python installation?
Getting the version number of your Python installation is not as straightforward as you might have guessed. But once you get the pythonic way of doing things, the implementation starts to make sense. The way to know the Python version is thus:
import sys
sys.version[:5]
Exercise
- What would happen if you just do
sys.version
instead ofsys.version[:5]
? - What is the pythonic way?
- Type
import this
at the Python console. - Is there any other way to know the Python version?
Useful Links
Make a Comment