Modes of execution in python
Python can be executed in the following two ways. Basically python has two modes namely:
- Interactive mode
- script mode
1. Interactive mode programming
- In this mode of execution we can run commands, can execute single or few lines of code very easily and with the great convenience.
- The symbol “>>>” denotes that the shell is ready for use.
- The following figure represents the interactive mode programming.
2.Script mode programming
- Another way to execute python programs is Script mode.
- In this we can execute single or many lines of code and save this in a file with “.py” extension
- For this double click on IDLE -> ctrl+n -> ctrl+s
- Type your code and execute it by clicking on run ->run module, otherwise press “F5”.
- The below figure represents the script mode programming.
6. If you click ‘f5’, you will get the following output