Python is an interpreted language. We can either collect sequences of commands into text files and save this to a file as a Python program. It is convention that these files have the file extension “.py",for example
We can also enter individual commands at the Python prompt which are immediately evaluated and carried out by the Python interpreter. This is very useful to understand how to use certain commands (often before one puts these commands together in a longer Python program )
To start the interpreter we can either
On windows/Linux : start IDLE
On windows: Find the MS-DOS prompt, and type python followed by the return key.
On Linux/Unix/Mac OSX: Go to the terminal type python followed by the return key.
The python prompt (the chevron >>>) signals that Python is waiting for input from us:
We can now enter commands, for example 4+5, followed by the RETURN key.
Once we press the return key, Python will evaluate the expression (4+5) and display the computed value (9) in the next line. It then displays the python prompt (>>>) in the next line to indicate that it is ready for the next input.
This interactive programming environment is sometimes referred to as the read-eval-print loop (REPL), because the expression is read, evaluated, the result is printed, and then the loop starts again.
Now you can try the other arithmetic operations
+(add) -(sub) *(mul) /(div) //(floor div) %(mod) **(exp)
Try the operations with integers ( Eg 3+4) float ( Eg:3.4+5.6) and complex( Eg:3+4j + 5+2j) numbers.