Install Python 3 on Ubuntu 18.04 or 20.04
Step1 : Check your version of Python
python --version
Step 2: Install Supporting Software
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
Step 3: Download the Latest Version of Python Source Code
wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz
Step 4: Extract Compressed Files
tar -xf Python-3.8.3.tgz
Step 5: Test System and Optimize Python
cd Python-3.8.3
./configure --enable-optimizations
Step 6: Install a Second Instance of Python (recommended)
sudo make altinstall
sudo make install
Step 7: Verify Python Version
python3 --version