Note: I have done both solutions myself for my Windows 10 and Ubuntu 19 installations but I just renamed my python to python3 on windows, and it works fine. I have both installed currently even though I only use python 3 because cygwin and some google tools still rely on it.
Windows
Use the installer from python.org and the installer will install it alongside python 2. To run from the console you can run py -3
or you can create a batch file in your new python 3 directory to run it using the command python3
such as python3.bat
|| python3.cmd
:
.\python %*
to make sure it runs from the command line correctly
Linux
Most linux distros come with python 2 installed automatically, just run your package manager such as apt install python3
or whatever your package manager is.