When you write Python code, it's just plain text in a file. The computer can't do anything with text on its own. To make it do something, you hand the text to a program called the Python interpreter. The interpreter reads the text from top to bottom, one line at a time, and acts on each instruction as it gets to it.
Two consequences worth knowing:
REPL stands for Read–Eval–Print Loop. It's an interactive prompt: you type one line, hit Enter, and Python answers immediately. Great for experimenting.
>>> 2 + 2
4
>>> "hello".upper()
'HELLO'
You'll meet the REPL in Module 2.
A script is a file ending in .py that holds Python code. You write the code once, save the file, and you can run it whenever you want, as many times as you want.
# clean_monday_report.py
import pandas as pd
df = pd.read_excel("monday_raw.xlsx")
df = df.dropna()
df.to_excel("monday_clean.xlsx", index=False)
print("Done.")
This is what 90% of "automating boring stuff" looks like.
A Jupyter notebook (file extension .ipynb) is somewhere between a script and a Word document. You write code in little blocks called cells, and the output appears right below each cell. You can mix code, charts, and notes in the same document.
Notebooks are the standard format for data analysis — you'll see them everywhere in finance, science, and business analytics.
=PY() formula. The code runs on a server in the cloud and the result lands back in the cell. We cover this in Module 8.
| Situation | Use |
|---|---|
| "What does this single line do?" | REPL |
| "I want to run this same job every Monday." | Script (.py) |
| "I'm exploring data and want notes alongside." | Notebook (.ipynb) |
| "I want a Python value inside a spreadsheet cell." | =PY() in Excel |
If you want a taste before Module 2, you can run Python in a browser tab right now — try online-python.com or replit.com.
=PY() is a fourth option that runs Python inside an Excel cell.name = "your name here"
print("Hi, " + name + "!")
print("Today's Python lesson is going well.")
"your name here" to your actual name, and run it again.