How to remove python 2.7.15rc1 in Ubuntu 18.04

When I checked Python version as normal user, it is showing Python 2:

$ python --version
Python 2.7.15rc1

And when try to run as root :

# python --version
Python 3.6.7

Any suggestion how to remove this Python 2.7


You need to define the two different python versions

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.NN 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.NN 2

Then you need to choose which version should be defined as default

sudo update-alternatives --set python /usr/bin/python3.NN

Note! You need to check what version you have of python and replace NN with your version.

python2 --version
python3 --version