REPL in Python
REPL stands for Read Eval Print Loop
Stage | Meaning | Description |
---|---|---|
R | Read | Takes input from the user as a string |
E | Eval (Evaluate) | Evaluates the string as Python code |
P | Displays the result of the evaluated code | |
L | Loop | Waits for the next input |
It is the interactive shell available with python software. When you install python in your system, it comes automatically.
Open your system command prompt and type python and press Enter. Then your python interactive shell (>>> powershell) will be open as shown below.
Here every line that you type will be evaluated immediately.
REPL is a Calculator
R : Reads the input as it is equivalent to python input() function
E : Evaluate / parses it as it is equivalent to python eval() / exec() function.
P : Print the result like python print() function.
L : Waits for next input like a loop.
Example :
Comments
Post a Comment