# for docker
apt install software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt install python3.8
# the answer is given by Merwanski for linux:
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.8
python3.8 --version
# you could also simply go to: https://www.python.org/downloads/ and find your preferred version.
# install it for your OS.
# download it from here
https://www.python.org/downloads/release/python-379/
# https://www.python.org/downloads/release/python-370/
# change the last 3 digits in the link to determine version
# (e.g: '370' -> 3.7.0 && if you want 3.7.5 version just change them to '375')