Python Arena
Step 1 of 5

Your first Python program

A program is a list of instructions that a computer carries out one after another. You write the instructions as text, called source code, and a program called the Python interpreter reads that text and does what it says. When you press Check or Run on this site, the real Python interpreter (CPython, the same Python you would install on a computer) runs your code right here in your browser.

The print command

The first command to learn is print. It shows a line of text on the screen:

print("Hello, Python!")
Output
Hello, Python!
  • print is the name of the command. Python calls commands like this functions; later modules show how to write your own.
  • The parentheses ( ) hold what the command works on.
  • The text between the double quotes " is what gets printed. Text in quotes is called a string. The quotes themselves are not printed: they only show Python where the text starts and ends.

A Python program needs no other frame around it: the line above is a complete program. Python simply runs the lines of the file from top to bottom.

Small letters matter

Python reads print and Print as two different names. Commands like print are written in small letters, exactly as shown. If one letter is off, Python stops and tells you which name it doesn't know. Step 5 of this module shows how to read those messages.

Your task

Challenge 1 of 3

Fill in the blank so the program prints Grace Hopper, the name of a computing pioneer.

Challenge 2

The text to print is missing its quotes. Fill in the two blanks with the character that starts and ends a string, so the program prints Python runs on quotes.

Challenge 3

This time the editor is empty. Write the whole program yourself: one line that prints Ready, set, code!