REPL

What is REPL?

REPL is the language shell.

Its short for Read, Eval, Print and Loop.
To start the language shell, type ‘python’ and press enter.

$ python
Python 3.6.1 (default, Mar 27 2017, 01:39:26)
[GCC 6.3.1 20170306] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> 700713 + 700713 # read, eval
1401426 # print
>>> # loop

Then it starts this process:

  1. Read: take user input.
  2. Eval: evaluate the input.
  3. Print: shows the output to the user.
  4. Loop: repeat.

Related Courses:
Complete Python Bootcamp: Go from zero to hero in Python

REPL

We can type all kinds of input in the interactive shell:

>>> 128 / 8
16.0
>>> 8 * (8 * 8)
512
>>> 256 * 4
1024
>>>
Note: We’ll teach you how to start python programs in the next article.

 
If you get an error when typing Python, install Python or set your environment variables. The method for setting this varies per operating system.

Previous Post
Next Post

Leave a Reply