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.