Once you have installed Python the next thing that you can do is to play around with the Python interpreter.
The Python interpreter is invoked by launching either the command window or by locating the python.exe file from the start menu. It can execute commands and display the result instantly. It is highly recommended that you initially try out various basic commands directly at the command window before you move on to more complex programming.
Launching Python Interpreter
Go to START Menu and locate the Python 3.x folder. Click on that and you should see the Python 3.x (32/64 bit) exe file.
When you click on the Python 3.x (32/64 bit) icon it will launch a command window as shown below.
You can now start typing commands in the window.
Trying adding two numbers Example: 6 + 7
You can also open up a command prompt by pressing WINDOWS key + R and type cmd in the Run window.
In the command window type python which will start the Python Interpreter. Whenever the python interpreter is available you should see the three greater than symbols. >>>
If your python is properly added to the PATH environment variable then you can type python in the command window that is launched from any directory path.
How to check if PATH is properly configured?
Launch the command window
Type PATH and press enter. You should see list of various application paths configured and you should also see python path among them.
This is automatically added when you had checked the Add Python 3.x to PATH during the installation. If you hadn’t then use enter the below command in the CMD window.
Replace the “C:\Users\NS\AppData\Local\Programs\Python\Python36” with the path of your python installation directory.
IDLE Integrated Development Environment
Another way to launch the python interpreter is to IDLE (Python3.x 32/64-bit) Integrated Development Environment that is provided when you install Python.
The difference between command window and the IDLE editor is that you get features like Debugger, Stack Viewer, Class Browser, etc.
The other compelling reason why you should use the IDLE editor rather than using the interpreter is that the python interpreter can only execute one command at a time.
If you try to paste multiple lines of command at once then it will throw the following syntax error:
“SyntaxError: multiple statements found while compiling a single statement“