Ubuntu 16.04 itself is a python, and he's a 2-self. X and 3.X, two versions, the default is 2. X. Here's a note of how to switch between versions and how to switch the Python version to 3. The method under X.
1. View the installed Python version of the Ubuntu system and the Python version currently in use
Ls/usr/bin/python*python--version
Or
2. Set update-alternatives switch python version
Show Python instead of version information
Update-alternatives--list python
Show after execution
Update-alternatives:error:no Alternatives for Python indicates that the Python replacement version is not installed
Perform the command installation
Update-alternatives--install/usr/bin/python python/usr/bin/python2.7 1
update-alternatives:using/usr/bin/python2.7 to Provide/usr/bin/python (python) in auto mode
Update-alternatives--install/usr/bin/python python/usr/bin/python3.5 2
update-alternatives:using/usr/bin/python3.5 to Provide/usr/bin/python (python) in auto mode
View the default version
Python--version
In the above command, because we set the priority of/usr/bin/python3.5 setting to 2, update-alternatives commands to set 3.5 as the default
Show Python instead of version information again
Update-alternatives--list python
Toggle version Update-alternatives--config python
Select an ordinal to toggle.