Skip to main content

Use of interactive prompt or mode in python

On starting python interactive mode we get below output

Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

In interactive mode it is not necessary to use “print” command explicitly. see below

>>> print("python interactive")
python interactive
>>> "python interactive"
'python interactive'

Interactive prompt runs code and echo immediately. But code which we write on interactive prompt does not get saved. To perform experiment with functions in python we can use this prompt. interactive prompt runs one statement at one time.

Run python program online here