Loading
0x00Lesson 1 of 6

Run your first Python program

Print text, read output and recognize how Python runs a script.

12 min 5-question quiz 1 code exercise
By the end of this lesson you can
  • Print a message and describe what the interpreter does.

Python is a general-purpose programming language with readable syntax. A Python interpreter runs instructions in your script. The print() function displays information.

main.py
print("Hello, world!")
Output
Hello, world!

Text is written inside quotes. Parentheses pass that text to print. Python executes statements in order, from top to bottom.

Key takeaways

  • Print a message and describe what the interpreter does.

  • Read the output to check what your program did.

  • Keep indentation consistent in Python blocks.

Lesson quiz

5 questions · pass with 4 correct · up to 50 XP

Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.

Practice: write Python

Write Python in the editor and run it against sample inputs. Python runs locally in your browser using a WebAssembly runtime.

Exercise 1

Say hello

+25 XP

Print exactly Hello, Python! on one line.

  • Greeting
main.py
Loading editor…

Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.

Questions about this lesson

Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.

Loading posts…

Did you like the lesson? 😆👍
Consider a donation to support our work: