Beginner·3 min·basics · print · strings
Hello, World!
Your first 3 minutes: change the example, press Run, then pass the first exercise. No signup is needed. Sign in only when you want to save progress.
You’ll be able to
- Write your first Python program using
print() - Store text in variables and format it with f-strings
- Understand what makes Python's syntax beginner-friendly
- Run real Python code in your browser without installing anything
Why this matters
Every Python script, from a Django manage.py shell to a Kaggle notebook, starts with print() as the debugger of last resort. Interviewers use FizzBuzz to filter candidates in 90 seconds, and it hinges on nothing more than print and a loop.
Common pitfalls
- Forgetting quotes around strings:
print(hello)raisesNameErrorbecause Python treatshelloas a variable. - Mixing
'and"inside the same string without escaping breaks the parser; pick one style or use triple quotes. - Assuming
printreturns the string. It returnsNoneand writes to stdout as a side effect.
Every programming journey starts here. print writes a line of text to the output.
What's happening?
print("...")is a function call. The text inside the quotes is a string.- The
f"..."form is an f-string — it lets you drop variables straight inside a string with{name}.
Try it
- Change the name to your own.
- Add a third line that prints today's vibe.
Practice
3 graded exercises
Write the code, click Check. We’ll tell you exactly what to fix.
Progress0 / 3
- Exercise 1
Print the word Python exactly (case-sensitive).
- Exercise 2
Print the sum of
5and7. Your output should be exactly12. - Exercise 3
Set a variable named
greetingto the string"Hello", then printHello, Worldusing an f-string that uses that variable.