Back to setup choices

Lesson 1 of 9 | 10 minutes

What Is Python and Where Does It Run?

Meet the few pieces that turn Python code into useful output.

After this lesson, you can

  • Explain Python, interpreter, package, notebook, and environment in plain language.
  • Distinguish .py scripts from .ipynb notebooks.
  • Run and edit a first Python example.

1. The simple picture

Python is a programming language: a clear way to give instructions to a computer.

A Python interpreter reads those instructions. Packages add tools for data, statistics, graphs, and econometrics. The interpreter then returns output.

  • Editor: where you write code.
  • Interpreter: what runs the code.
  • Package: extra tools Python can use.
  • Environment: an organized package space for one course or project.
  • Notebook: explanation and executable cells in the same document.

2. Files and tools

  • .py is a Python script.
  • .ipynb is a notebook file.
  • A terminal is a text interface for running commands.
  • A notebook runs code in cells.
  • An IDE or editor helps you write, organize, and debug code.

Python code to output

Python codeInterpreterPackagesOutput

Live Python

Your first Python message

Your first Python message

Stdout

Run Python to see results here.

Status / stderr

Ready to run Python in your browser.

Line-by-line guide

  1. Line 1Display a result so students can inspect the output.

Expected output

Hello from Ceteris Lab!

Live Python

Change the numbers

Change the numbers

Stdout

Run Python to see results here.

Status / stderr

Ready to run Python in your browser.

Line-by-line guide

  1. Line 1Create or update a Python object used in the analysis.
  2. Line 2Create or update a Python object used in the analysis.
  3. Line 3Display a result so students can inspect the output.

Expected output

15

Challenge

Change x and y, then run the code again.

Your setup progress

Five readiness checkpoints

0% complete