The Python interpreter processes text-based program code, and also has an interactive mode where you can test snippets of code and is useful for debugging code. Python’s interactive mode can be entered in a number of ways:
Irrespective of the method used to enter interactive mode, the Python interpreter will respond in the same way to commands entered at its >>> primary prompt.
In its simplest form, the interpreter can be used as a calculator.
Enter Python interactive mode, using any method outlined opposite, then type a simple addition and hit Return to see the interpreter print out the sum total.
The Python interpreter also understands expressions, so parentheses can be used to give higher precedence – the part of the expression enclosed within parentheses will be calculated first.