install python3.6 in linux

$ sudo nano /etc/apt/sources.list
# add
deb testing main
$ echo 'APT::Default-Release "stable";' | sudo tee -a /etc/apt/apt.conf.d/00local
$ sudo apt-get update
$ sudo apt-get -t testing install python3.6
$ python3.6 -V

Here is what the above code is Doing:
1. Add the testing repository to your sources.list file.
2. Create a new file in /etc/apt/apt.conf.d/ called 00local.
3. Add the following line to 00local: APT::Default-Release “stable”;
4. Update your package list.
5. Install Python 3.6.
6. Verify that Python 3.6 is installed.