execution modes there are two ways to use the python interpreterainteractive mode bscript mode interactive mode allows execution of individual statement instantaneously whereasscript mode allows us to write more than one instruction in file called python source code file that can be executed (ainteractive mode to work in the interactive modewe can simply type python statement on the prompt directly as soon as we press enterthe interpreter executes the statement and displays the result( )as shown in figure figure python interpreter in interactive mode working in the interactive mode is convenient for testing single line code for instant execution but in the interactive modewe cannot save the statements for future use and we have to retype the statements to run them again (bscript mode in the script modewe can write python program in filesave it and then use the interpreter to execute it python scripts are saved as files where file name has extension pyby defaultthe python scripts are saved in the python installation folder to execute scriptwe can eitheratype the file name along with the path at the prompt for exampleif the name of the file is prog - pywe type prog - py we can otherwise open the program directly from idle as shown in figure bwhile working in the script modeafter saving the fileclick [run]->[run modulefrom the menu as shown in figure -