update python version linux code example

Example 1: ubuntu install python

# first do:
sudo apt-get update
# after do:
sudo apt-get install python3.6
# then it should be installed

Example 2: command to upgrade python version

python -m pip install pip
#or
python -m pip install –upgrade pip
python -m pip install --upgrade pip

Example 3: how to change python version on linux

#Check available versions
ls /usr/bin/python*
#Change the used version 3.5 or 3.7 etc
alias python='/usr/bin/python3.x'
#do this other thing
. ~/.bashrc
#Check version 
python --version

Example 4: update python ubuntu

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install python3.7

Example 5: update python ubuntu

$ sudo apt update -y
$ sudo apt install python3.7