print(): put words and numbers on the screen
print() is how your program talks. Every sign, receipt, and message a program shows starts with this one command.
The big idea
print() shows whatever is inside its parentheses in the output console, then moves to a new line.
See it in code
Put words inside quotes, inside the parentheses. Each print line makes one line in the output console:
print("=== ELECTRIC BAKERY ===")
print("Fresh cookies today")=== ELECTRIC BAKERY === Fresh cookies today
Lines run in order, from the top down. The first print in your code is the first line on the screen.
Numbers don't need quotes. And one print can show two things if you put a comma between them:
print(12)
print("Cookies left:", 12)12 Cookies left: 12
The comma does two jobs. It separates the two things, and it adds a space between them for you.
A real sign keeps its values in variables, so one change updates every line that uses it:
sign_title = "=== ELECTRIC BAKERY ==="
special = "brownies"
cookies = 12
print(sign_title)
print("Today's special:", special)
print("Cookies left:", cookies)=== ELECTRIC BAKERY === Today's special: brownies Cookies left: 12
print(sign_title) shows what the variable holds, not the word sign_title. Quotes mean "show these exact words." No quotes means "look this name up."
Printing is also how coders check their work. When a program does something odd, a quick print of a variable shows what the program is really holding.
Try it yourself
Add a fourth line to the sign that prints "Cookie of the day:" and a flavor you choose. Then move your new line to the top and run it again. What changed?
The common mistake
Leaving the quotes off words. print(Fresh cookies today) confuses Python, because without quotes it thinks those are names it should look up. Words always go in quotes.
What it unlocks
Next, make your output neater with f-strings, which drop values right into a sentence. And when something breaks, print() is your first tool for debugging.