📚

Hello World

Your First Python Command

When you write a program, the computer does exactly what you tell it — but it won't show you anything unless you specifically ask it to. That's what

print()
does: it tells Python to display something on the screen.

Here's how it works:

print("Hello, World!")

Let's break this down piece by piece:

  • print
    — the name of the command (called a function)
  • ( )
    — parentheses tell Python "here's what I want you to print"
  • "Hello, World!"
    — the text you want to display, wrapped in quotes

The quotes are important! They tell Python "this is text, not a command." You can use single quotes

'Hello'
or double quotes
"Hello"
— both work exactly the same.

print("Hello!")   # → Hello!
print('Hello!')   # → Hello!  (same result)
print(42)         # → 42  (numbers don't need quotes)
💡

💡 Your Turn: Write

print("Hello, World!")
in the editor and click Run. You've just written your first Python program!

main.pySandbox
main.py