Skip to main content

Chapter 1a - Printing

Printing Messages​

print("Hello World!")
print('Hello World!')
πŸ§ͺ Try it

Mini quiz β€” print​

Quiz

print

1 / 2

What does this show?

print("Hello")

Pick an answer to see if you are right.

Japanese Emoticons project

Printing numbers​

print(4 * 3) prints 12, not the text 4*3.

πŸ§ͺ Try it

Challenge: print a product​

Write product() so it prints the result of 6 * 7 (one number, nothing else).

Special characters​

\n starts a new line. \\ prints one backslash.

πŸ§ͺ Try it

Mini quiz β€” escape characters​

Quiz

Escape characters

1 / 2

What does \n do inside a string?

Pick an answer to see if you are right.

Exercises​

Activity: Two lines

Write greet() so it prints Hi on the first line and Ada on the second line.

Hi
Ada