Python has 2 execution modes:

  • Interactive mode
  • Script mode

Interactive 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

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”.

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.