Hello, Python!
Lesson 1 of 7 · View course roadmap
Learn the idea
Python is the world's most popular programming language — used by NASA, Netflix, Instagram and millions of developers. It reads almost like English, which makes it the perfect first language.
The print() function displays text on the screen. Text wrapped in quotes is called a string:
Lines starting with # are comments — notes for humans that Python ignores completely. Use them to explain why your code does something.
print("text")— outputs text# comment— ignored by Python- You can print several values:
print("a", "b")puts a space between them
Where you'll use this
print() is a developer's first debugging tool — professionals sprinkle prints to inspect running programs before reaching for real debuggers, and every CLI tool you've ever used writes its output exactly this way.
Common mistakes
- Forgetting the parentheses:
print "hi"worked in Python 2 but is a SyntaxError in Python 3. - Mismatched quotes:
print("hello')— start and end with the same quote character. - Writing code after a comment on the same line and expecting it to run — everything after
#is ignored.
Pro tip
print() accepts a sep= and end= argument: print("a", "b", sep="-", end="!") gives a-b!. You'll use end="" whenever you want to print without a newline.
Watch how it runs — line by line
Press play to watch Python execute this code, one line at a time.
Try it yourself
The lesson example is loaded and ready — press Run, then change something and run it again. Breaking it is part of learning. Want a clean slate? Tap “New blank”.
Output appears here…
Pass the challenge +20 XP
Print exactly two lines: first Hello, Python! and then I am learning to code.
Hello, Python! I am learning to code
Use two separate print() calls. Match spelling and capitalisation exactly.
print("Hello, Python!")
print("I am learning to code")
Run your code to check it…
Check your understanding
Your notes (saved on this device)
Tip: use ← and → to move between lessons, ⌘K to search everything.