{"id":"printing-first-program","slug":"first-program","title":"Your first Python program","text":"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.\n\n### The print command\n\nThe first command to learn is `print`. It shows a line of text on the screen:\n\n```python\nprint(\"Hello, Python!\")\n```\n\n```output\nHello, Python!\n```\n\n- `print` is the name of the command. Python calls commands like this **functions**; later modules show how to write your own.\n- The parentheses `( )` hold what the command works on.\n- 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.\n\nA 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.\n\n### Small letters matter\n\nPython 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.\n","task":"Fill in the blank so the program prints `Grace Hopper`, the name of a computing pioneer.\n","kind":"fill","seed":"[[print]](\"Grace Hopper\")\n","solution":"print(\"Grace Hopper\")\n","hints":["The command that shows a line of text is `print`.","Type only the command's name into the blank: `print`, in small letters. The parentheses and the quotes are already there."],"tests":[{"name":"Output","stdin":"","expect":"Grace Hopper","hidden":false}],"require":[],"forbid":[],"more":[{"task":"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`.\n","kind":"fill","seed":"print([[\"]]Python runs on quotes[[\"]])\n","solution":"print(\"Python runs on quotes\")\n","hints":["A string starts and ends with a double quote `\"`.","Type one `\"` into each blank."],"tests":[{"name":"Output","stdin":"","expect":"Python runs on quotes","hidden":false}],"require":[],"forbid":[]},{"task":"This time the editor is empty. Write the whole program yourself: one line that prints `Ready, set, code!`\n","kind":"code","seed":"# Write your program below this line.\n","solution":"# Write your program below this line.\nprint(\"Ready, set, code!\")\n","hints":["Start with the command's name: `print`.","The text goes inside the parentheses, between double quotes: `print(\"...\")`.","Copy the text exactly, with its capital R, the commas and the exclamation mark."],"tests":[{"name":"Output","stdin":"","expect":"Ready, set, code!","hidden":false}],"require":[],"forbid":[]}]}