Process of writing a program (Interactive & Script mode)

 Process of writing a program (Interactive & Script mode)


Python provide two modes to do programming these are
  • Interactive mode
  • Script mode

The normal mode is the mode where the scripted and finished .py files are run in the Python interpreter.

Interactive mode is a command line shell which gives immediate feedback for each statement, while running previously fed statements in active memory. As new lines are fed into the interpreter, the fed program is evaluated both in part and in whole.

Interactive mode is a good way to play around and try variations on syntax.Interactive mode allows you to test out and see what Python will do.

The >>> is Python's way of telling you that you are in interactive mode.
In script mode, useful when we write a program for real world like multiple line of python codes and dependency to top to bottom.
In script mode , you need to create .py file in notepad or any editor and write code with python syntax and save it, then open python command/terminal and run it with command - py filename.py see the image i used hello.py


Comments

Popular posts from this blog

OutSystems – A Low-code Development Platform

What is difference between Azure Cognitive Search and Elastic Search

failed to access iis metabase asp.net