Computer >> Computer tutorials >  >> Programming >> Python

How do we use Python in interactive mode?


Execute Python from command prompt to run Python interactive shell.

C:\user>python
 >>>

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
 17

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'