Python Arena
Step 4 of 5

Quotes and comments

Python accepts strings in single quotes ' as well as double quotes ". Both mean the same, as long as the string starts and ends with the same kind. That comes in handy when the text itself has quotes in it:

print('She said "hi" and left.')
print("It's a good day.")
Output
She said "hi" and left.
It's a good day.

The first string is in single quotes, so the double quotes inside it are just characters. The second is in double quotes, so the apostrophe in It's doesn't end it.

Comments

A line that starts with # is a comment. Python skips it completely: comments are notes for the people who read the code. A comment can also come after the code on a line; everything from the # to the end of that line is skipped:

# How many eggs the bakery needs this week
print("Eggs needed:")
print(12 * 6)  # 12 cakes with 6 eggs each
Output
Eggs needed:
72

Programmers also use # to switch a line off for a moment without deleting it. This is called commenting out a line.

Your task

Challenge 1 of 3

The program should print the line below, double quotes included. Change the program so it works.

The sign said "Keep out" in red letters.

Challenge 2

Write a program that prints this tip for new programmers, exactly as it is:

To greet, type print("Hi") and press Run.

Challenge 3

The program prints a test message that shouldn't be there any more. Comment out that line (don't delete it), so the program prints only:

Welcome!
Have a nice day.