How can I uninstall python 2.7 and reinstall 3.5 ?
Answer: You Can’t !
But we have a solution 😉
By default in latest Ubuntu release python and python3 are already included and if you completely remove python 2.7 it may break your system type in terminal
to open python 3 interpreter and when you run your scripts type
and if not already included type in terminal
sudo apt-get update && sudo apt-get install python3
ONCE PYTHON3 IS INSTALLED, CREATE AN ALIAS FOR PYTHON TO CALL PYTHON3 INSTEAD.
at the bottom of
~/.bashrc file (or simply
echo "alias python=python3" >> ~/.bashrc)
from the terminal to update bash with the changes.