1. First enter the Ubuntu system, and then use ‘Ctrl Alt T’ to open the Ubuntu command line terminal.
2. Then the Ubuntu system generally contains two versions of Python, python2 and python3. When we query the python version specified by the system by default, we use the command [python --version] to query.
3. Then the Ubuntu system generally contains two versions of Python, python2 and python3. When we query the corresponding python version, we use the command [python2 --version]/[python3 --version] to query.
4. In addition to the above methods, we can also enter Python to view. After entering Python, the current version number will pop up by default, command [python].
5. After finally entering python, you can use sys to query the system installation path and resource path corresponding to python, command [import sysprint(sys.path)].
The above is the detailed content of How to check the current version number in Python_How to check the current version number in Python. For more information, please follow other related articles on the PHP Chinese website!