How do we use Python in interactive mode?

PythonServer Side ProgrammingProgramming

Execute Python from command prompt to run Python interactive shell.


Python prompt is made up of three greater than symbols. Any valid expression can now be evaluated interactively. Let us start with evaluating arithmetic expression.

>>> 2+3*5

You can assign value to a variable or accept input from user, and print its value.

>>> name=input("enter your name")
enter your name TutorialsPoint
>>> name
 ' TutorialsPoint'
Published on 26-Dec-2017 23:54:07