⬅ Previous Topic
Introduction to PythonNext Topic ⮕
Python Variables⬅ Previous Topic
Introduction to PythonNext Topic ⮕
Python VariablesWelcome to your very first step in learning Python!
We’re going to write a small program that tells the computer to say: Hello, World!
This is a tradition in programming — it’s how almost everyone starts learning any programming language.
print()
command meansType this line exactly as it is:
print("Hello, World!")
print
is a command that tells Python to show something on the screen."Hello, World!"
) is what will be shown.print("Hello, World!")
main.py
(make sure it ends with .py
)python main.py
and press Enter.You can also run Python code directly in the interactive shell — no file needed!
python
or python3
and press Enter.>>>
>>> print("Hello, World!")
Output:
Hello, World!
This is called the Python interactive shell or REPL (Read-Eval-Print Loop). It's great for testing small pieces of code quickly.
You just wrote and ran your first Python program!
From here, you’ll start learning how to work with numbers, text, and more. But always remember: every big journey starts with a small step — and this was your first!
⬅ Previous Topic
Introduction to PythonNext Topic ⮕
Python VariablesYou can support this website with a contribution of your choice.
When making a contribution, mention your name, and programguru.org in the message. Your name shall be displayed in the sponsors list.