Code is a set of instructions you give to a computer, written in a language the computer understands. Python is one of those languages — and it's famous for being easy to read.
A computer does exactly what you tell it, in order, one line at a time. Your job as a programmer is to give it clear, correct instructions.
🗣️ The print() command
The most important first command is print(). It tells Python to show something on the screen. You put the message inside the parentheses, wrapped in quotation marks.
print("Hello, World!")
When you run that line, Python shows:
Hello, World!
📌 Why quotes?
The quotation marks " " tell Python "this is plain text — print it exactly." Text inside quotes is called a string. You can use double quotes "like this" or single quotes 'like this' — just match them!
📚 Printing more than once
Each print() shows its message on its own line. Run several in a row to make a list or a poem:
print("Roses are red")
print("Violets are blue")
print("Python is fun")
print("And so are you!")
💬 Comments — notes for humans
A line that starts with # is a comment. Python ignores it completely. Comments are notes you leave for yourself or other people to explain what the code does.
# This is a comment — Python skips it
print("But this line runs!") # you can comment at the end too
⚠️ Watch out for tiny mistakes
Common beginner bugs
Forgetting a quotation mark: print("Hi) ❌
Forgetting the parentheses: print "Hi" ❌
Spelling it wrong: Print(...) — Python is case-sensitive, use lowercase print ❌
Don't worry — every programmer makes these. The Practice tab lets you experiment safely!
✅ What you learned
print() shows text on the screen.
Text inside quotes is called a string.
# starts a comment that Python ignores.
Python runs your lines top to bottom, one at a time.
🎮 Time to Practice!
Write your code in the dark box, press ▶ Run to see the result, and press ✓ Check when you think you've nailed it. Stuck? Peek at the 💡 Solution.
⭐
Task 1: Hello, World!
Easy
Every programmer's first program! Make Python print exactly: Hello, World!
print("Hello, World!")
🪪
Task 2: All About Me
Easy
Print these three lines, each with its own print():
My name is Alex
I am 10 years old
I love coding!
print("My name is Alex")
print("I am 10 years old")
print("I love coding!")
🎄
Task 3: ASCII Art Tree
Medium
Use spaces and the * symbol to print a little tree. The output must be exactly:
*
***
*****
💡 Hint: the first line has two spaces then a star. The second has one space then three stars.
print(" *")
print(" ***")
print("*****")
🎨
Task 4: Free Play — Your Signature
Creative
There's no wrong answer here! Print your own name, your favorite animal, and a joke. Add a comment with # explaining one line. Press ▶ Run to see it.
🏋️ Extra Practice — Drill Time!
One or two tasks is never enough to make a skill stick. Work down this list — each one is a little harder than the last. Type every line yourself (no copy-paste!), press ▶ Run, then press ✓ Check.
📇
Task 5: Three Facts
Easy
Print exactly three lines about a made-up kid: their name, their age, and their favorite food. Match this output exactly — spelling and capital letters matter to Python!
My name is Ana
I am 10 years old
I love pizza
print("My name is Ana")
print("I am 10 years old")
print("I love pizza")
🧮
Task 6: Python the Calculator
Easy
print() can do math too — anything without quotes gets worked out first. Print the answers to 7 * 6, 100 - 45 and 12 + 8, one per line. (No quotes anywhere!)
42
55
20
print(7 * 6)
print(100 - 45)
print(12 + 8)
🔗
Task 7: Commas Glue Things Together
Easy
Inside print() you can list several things separated by commas, and Python puts a space between them. Print I have 3 cats and 2 dogs using commas, with the numbers written without quotes.
I have 3 cats and 2 dogs
print("I have", 3, "cats and", 2, "dogs")
🗓️
Task 8: The sep Trick
Medium
print(a, b, sep="-") glues the pieces with a dash instead of a space. Print the date 2026-01-15 from the three separate numbers 2026, 1, 15… careful, you need "01" as text to keep the zero!
2026-01-15
print("2026", "01", "15", sep="-")
➡️
Task 9: The end Trick
Medium
Normally print() jumps to a new line. Add end=" " to stay on the same line. Print Ready Set Go! using three separateprint() calls.
To put double quotes inside your text, wrap the whole thing in single quotes. Print this line exactly:
She said "Python is fun!" and smiled
print('She said "Python is fun!" and smiled')
🗒️
Task 11: Comment It Out
Easy
A line that starts with # is a comment — Python skips it completely. Write three lines: a comment saying this is my homework, a print of Line one, and a print of Line two. Only two lines should appear.
Line one
Line two
# this is my homework
print("Line one")
print("Line two")
🚀
Task 12: Boss Level: Rocket Countdown
Boss
Print a countdown from 5 down to 1, each on its own line, then LIFT OFF! 🚀. You only know print() so far — that means six print() lines. (Later you'll do this with a loop in one line!)
Use print() lines to draw ASCII art: a house, a rocket, your initials, anything. Try to make it at least 5 lines tall. There is no wrong answer — just make it awesome. 🎨