Meet Python
Python is a programming language: a way to write instructions for a computer in words that read almost like English. A program called the interpreter, python, reads your code and carries it out.
Type python in a terminal and you get the interactive prompt, >>>, also called the REPL: it reads a line, runs it, prints the answer and loops. Here 2 + 3 gives 5 at once.
A real program lives in a file, here hello.py. Run python hello.py and Python reads the whole file, then runs it one line at a time, from top to bottom.
Line by line
Line 1 starts with #, so it is a comment: a note for people reading the code. Python skips everything from # to the end of the line, so nothing appears in the terminal.
print() shows a value in the terminal. "Hello!" in quotes is a string, a piece of text. Python prints it without the quotes, then moves on to the next line.
input() first writes its question, Name?, and then waits. The program pauses on this line until you type an answer and press Enter.
You type Sam and press Enter. input() gives back what you typed as a string, 'Sam', and = stores it under the name name. That is a variable: a name for a value in memory.
Line 4 reads name from memory. print() writes its items with one space between them: Hi, Sam. That was the last line, so the program ends and the terminal waits for you again.
One rule
Spaces at the start of a line mean something in Python: they group lines into blocks. Give line 2 two stray spaces and Python refuses to run any of the file: IndentationError.
Try it yourself
;; step 1/9
# Python code reads almost like English:
print("Hello!")
# the interpreter is the program that runs it:
$ python --version
Python 3.14.0 # your version may differ
On macOS and Linux the command is often python3 rather than python; on Windows the py launcher also works. The $ and > at the start of a line are the terminal's own prompt: you do not type them. Python reads and compiles the whole file before it runs the first line, which is why a badly indented line 2 stops the program before Hello! is printed. In the real message, the ... is the full path to the file.