Codiqo

Learn Python · lesson 1 of 60 · about 4 minutes

Hello, Python

Make your own assistant talk: print messages, write text as strings, and fix your first error.

What you'll learn

  • Show messages with print()
  • Write text as a string in quotes
  • Put an apostrophe inside a string

Make your assistant talk

Every morning you have the same few jobs, and every morning you forget one. A short Python script can tell you them instead. That's what Python is for: little programs that do the boring bits of your day.

A program is a list of instructions, run from the top down. print() shows whatever is inside its brackets.

Your assistant's first words

print("Good morning!")
print("Today: water the plants")

Output

Good morning!
Today: water the plants

Text is called a string

"It's a sunny day." is a string: a piece of text in quotes. Double quotes and single quotes both work, but a string has to end with the same quote it started with.

The quotes aren't part of the text. They only show Python where the text starts and ends.

Text with an apostrophe goes in double quotes

print("It's a sunny day.")

Output

It's a sunny day.

Tip

Python is case-sensitive: print works, but Print is an error, because Python doesn't know that name.

Now try it yourself

This lesson is free in Codiqo, with 5 questions on what you just read. You can only learn to code by writing code, so it ends with a short program you write yourself, which we run and check straight away.