From the course: Visual Studio Code for Python Developers
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
Using the Python REPL
From the course: Visual Studio Code for Python Developers
Using the Python REPL
- [Instructor] Earlier in the course, we saw a simple example of how to execute a line of Python code in the interpreter using Shift + Enter Let's take a closer look at that feature now which used the Python extensions R E P L or REPL feature. So REPL stands for Read Evaluate Print Loop, it's an interactive form of working with Python that you can perform directly within .vscode So let's open up a sample file here and it's called Test REPL, and to start the interpreter, first I'll select these few lines here so I import the math module and then calculate, well I don't really calculate anything, I'm just going to print out the value of pi. So I'm going to type Shift + Enter and you can see that when I do that, that starts the interpreter in the terminal and you can see that each of the lines of codes is being run in the interpreter and then there's the result right there. Now sometimes I found that .vscode will send the initial lines of code before the interpreter is actually ready. If…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.