Python has 2 execution modes:
- Interactive mode
- Script mode
Interactive mode allows execution of individual statements instantaneously.
To work in the interactive mode, we can simply type a Python statement on the prompt directly. As soon as we press enter, the interpreter executes the statement and displays the result(s).
Working in the interactive mode is convenient for testing a single line code for instant execution . But in the interactive mode, we cannot save the statements for future use and we
have to retype the statements to run them again.
Script mode allows us to write more than one instruction in a file called Python source code file that can be executed.
Python scripts are saved as files where file name has extension “.py”.