liveBook · Manning

Interpreter

As explained in Get Programming: Learn to code with Python

A Python interpreter is a program that executes programs written in the Python programming language.

Python names both a programming language and the interpreter: the program that runs code written in that language. You write statements; the interpreter executes them. section 3.1

Running calculations

Put these lines in a file and run it in Spyder: 3 + 2 4 / 5 print(3 + 2) print(4 / 5) The interpreter calculates all four expressions in order. The first two results do not appear in the console because nothing asks to display them. The print statements show 5 and 0.8, each on its own line. section 3.2

Try this quick check: which lines display a result—print(19) or 19 - 10? Run both to check. Later, decisions in a program can determine which statements the interpreter executes instead of always running every line in order. section 3.2 section 13.0

How Get Programming: Learn to code with Python covers it

How deep it goes
Defines the interpreter and walks through line-by-line execution, without explaining its internal implementation.
Examples
Uses arithmetic expressions, print statements, a Spyder run, and a quick check about what appears in the console.
What it assumes
Starts with a definition of the interpreter and introduces execution through small calculations rather than assuming programming experience.
What you can do after
Operate/configure it by running a Python file in Spyder and predicting which calculated values appear in the console.
How it connects
Connects expression evaluation and print output to later decisions about which statements execute.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Get Programming: Learn to code with Python. The section links point to the parts of the book it draws on.