Tutelage

Lessons › coding and computer science · taught by Leo

Your first Python program: print and quotes

Learn how Python runs a one-line program, use print(), and understand why quotes matter for text.

Learn this with Leo, freeA voiced lesson with a live whiteboard, quizzes and a tutor you can call, at tutelage.app

Meet Python as a tool

Python is a language for telling the computer what to do. We write a tiny program, then the computer follows it.

Think of it like giving a very clear recipe: one step at a time.

One line can do one job

A Python program can start with a single instruction. The computer reads top to bottom.

For your first program, we will use one line: print.

That tells Python to show something on the screen.

Predict what print does

What do you think this line does? print("Hello")

  1. Shows Hello on the screen
  2. Saves a file
  3. Makes a new folder
Show answer

Shows Hello on the screen: Yes. print sends text to the screen.

Write your first program

Here is the whole program. It is just one line.

The quotes matter. They mark the text you want shown.

The parentheses hold the thing print should display.

When you run it, Python sends Hello to the screen.

Quick check: quotes or not?

What is the correct next move if you want Python to show text?

  1. Put the text in quotes
  2. Leave the text unquoted
  3. Add random spaces
Show answer

Put the text in quotes: Correct. Quotes tell Python it is text.

Why quotes matter

Quotes are like a label that says, “This is just text.”

Without quotes, Python tries to interpret the word as something to use.

Run it in order

Python usually reads your file from top to bottom. Each line gets a turn.

If you add more lines later, Python follows them in order.

That is why clear, simple steps are so useful.

Your turn: choose the right line

Which line will show Hi on the screen?

  1. print(Hi)
  2. print("Hi")
  3. show("Hi")
Show answer

print("Hi"): Yes. That is the correct Python line.

Common mistake: missing quotes

A very common mistake is leaving off the quotes.

The fix is small, but important: add quotes around the words.

Your first program checklist

Use this checklist every time you start.

Type the line carefully.

Run it, then look at the output.

You can do this alone

You now know the whole pattern for a first program.

Type one line, run it, and read what Python shows back.

Learn this with Leo, freeA voiced lesson with a live whiteboard, quizzes and a tutor you can call, at tutelage.app