Answered Plainly

๐Ÿ Python Cheat Sheet โ€” For Kids

This is your pocket map of Python โ€” the commands a beginner really uses. Every card shows a tiny example, what it does in plain words, and what you will see when you run it.

Tap the ๐Ÿ“‹ Copy button on any example to copy it, then paste it into IDLE and run it. Or type the example yourself โ€” typing is great practice. Every example on this page was run on a real Python before this page was written, and the "You will see" lines are what Python really printed.

Pick your grade:

print โ€” Say Something

What it does: Shows words or numbers on the screen. The words appear, but the quote marks do not.

print("Hello, world!")

You will see: Hello, world!

input โ€” Ask a Question

What it does: Asks a question and waits for an answer. Whatever you type is saved in a variable (here, the variable is called name).

name = input("What is your name? ")
print("Hello, " + name + "!")

You will see: Python asks the question and waits. If you type Alex and press Enter, you will see: Hello, Alex!

Variables โ€” Boxes With Names

What it does: A variable is like a box with a name on it. The = sign puts something in the box. Here, the number 9 goes into a box named age.

age = 9
print(age)

You will see: 9

Numbers and Math Signs

What it does: Python is a calculator. + adds. - takes away. * (the star) means multiply. / means divide.

print(2 + 3)
print(10 - 4)
print(3 * 5)
print(8 / 2)

You will see: 5, then 6, then 15, then 4.0. (Divide answers wear a ".0" โ€” that is Python telling you it used division.)

Words in Quotes โ€” Text

What it does: Words inside quotes are called text (grown-ups call it a "string"). A + glues text together. A * repeats it.

print(3 * "un" + "ium")

You will see: unununium โ€” "un" three times, glued to "ium". (This silly example comes right out of Python's own tutorial!)

if / else โ€” Making a Choice

What it does: if asks a yes-or-no question. If the answer is yes, Python runs the lines that are pushed in with spaces. else means "otherwise" โ€” run these instead.

points = 10
if points >= 10:
    print("You win a star!")
else:
    print("Keep playing!")

You will see: You win a star! (The spaces at the front of the middle lines matter โ€” they tell Python those lines belong to the if.)

for and range โ€” Do It Again

What it does: for repeats a job. range(3) counts 0, 1, 2 โ€” it gives one number at a time, and the loop runs once for each.

for n in range(3):
    print(n)

You will see: 0, then 1, then 2, each on its own line.

Comments โ€” Notes With #

What it does: A # starts a note for people. Python skips notes completely โ€” they are only for you and other readers.

# This line is a note. Python skips it.
print("I run!")

You will see: I run!

๐Ÿ“– Words to Know

Variable โ€” a named box that holds a value, like a number or some text.

String โ€” text in quotes. (It sounds funny, but that is really its name.)

Loop โ€” lines of code that run again and again.

Condition โ€” a yes-or-no question Python checks, like a < 3.

Indent โ€” the spaces at the front of a line. In Python, indents are part of the rules: they show which lines belong together.

Function โ€” a command you build yourself with def, or one Python already has, like print.

๐Ÿš€ Keep Exploring

Ready to use these for real? Go to Your First Python Programs โ€” three whole programs to copy, run, and tinker with.

No Python on your computer yet? Start with an install page: Windows ยท Mac ยท Chromebook.

Sources

docs.python.org โ€” The Python Tutorial, "An Informal Introduction to Python" (numbers and math signs, text in quotes, lists, comments, the first while loop): https://docs.python.org/3/tutorial/introduction.html

docs.python.org โ€” The Python Tutorial, "More Control Flow Tools" (if/elif/else, for, range, and defining functions with def): https://docs.python.org/3/tutorial/controlflow.html

Every example on this page was also run with Python 3.12.3 on November 7, 2026, before this page was written โ€” the "You will see" lines match what Python printed. Checked against the sources above on November 7, 2026.