Lesson 7/48 ยท ๐ Your First Python
๐ Your First PythonLesson 7/48
Phase 1 ยท Your First Python15 min
Hello, World!
Write your very first Python program and understand how it works
Every programmer's first program is "Hello, World!", it's a tradition. More importantly, it teaches you the most fundamental thing in programming: telling the computer to display something.
Your first Python programpython
print("Hello, World!")print() is a function, a built-in command that tells Python to display something on the screen. Whatever you put inside the parentheses (in quotes) gets printed.You can print anythingpython
print("I am learning Python!")
print("This is line 2")
print(42)
print(3.14)Text vs numbers: Text (called *strings*) goes in quotes:
"hello". Numbers go without quotes: 42. If you put a number in quotes, Python treats it as text, not a number.Run the code in the terminal on the right to see it execute. Try changing the message and running again!
Practice Exercises
0/2 solvedExercise 1 of 2easy
โฑ 00:00Three Lines
Print exactly these three lines in order:1.
Hello from Python!2. I am learning to code3. 2026solution.py
1 / 2
Exercise 2 of 2easy
โฑ 00:00Print a Pattern
Print this exact pattern using 5 print() statements:
`**`solution.py
2 / 2
Solve all 2 exercises to unlock completion