"which" is not recognized as an internal or external command, operable program or batch file "python" code example

Example 1: 'python3' is not recognized as an internal or external command,

There is no python3.exe file, that is why it fails.

Try:

py

instead.

py is just a launcher for python.exe. If you have more than one python versions installed on your machine (2.x, 3.x) you can specify what version of python to launch by

py -2 or py -3

Example 2: 'python' is not recognized as an internal or external command

Did you add python to PATH when you downloaded it?
If not, redownload it and make sure you tick the box that says 'add Python to PATH'.