Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 987 Bytes

REPL.md

File metadata and controls

58 lines (38 loc) · 987 Bytes

REPL

Overview

This is using the python REPL. We will do this from the command line to illustrate the interactive nature of python code.

Step 1: Start python interpreter

Open an Anaconda command prompt (if you use Anaconda on Windows).

Run the following from the command line:

python3

This should put you in a python prompt looks something like this:

>>> 

Step 2: Start Typing Python Code

Type in the following code at the python prompt:

print("Hello world!")

a = 10
b = 3.1
c = "hello world"

Step 3: Evaluate the result of your variables

Note that our variables can be evaluated at the repl. Try the following commands.

a  # should return 10
b  # should return 3.1
c  # should return "hello world"

Step 4: Try to use your variables

Try some arithmetic operations with your variables, like this:

a + b
a * b
a / b

Step 5: Quit out of the REPL

You can exit with CTRL-D