Python Hello World Program

Hello World Program

Welcome 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.

Your First Python Program

Type this line exactly as it is:

print("Hello, World!")

How to Run This Program (Using a File)

  1. First, you need Python installed on your computer. Download it from python.org and follow the installation instructions based on your Operating System.
  2. Open a text editor like Notepad (Windows), TextEdit (Mac), or any code editor like VS Code.
  3. Type: print("Hello, World!")
  4. Save the file as main.py (make sure it ends with .py). This is the extension used for Python files.
  5. Open your terminal or command prompt.
  6. Go to the folder where you saved the file.
  7. Type: python main.py and press Enter.

How to Run This Program (Using Python Shell)

You can also run Python code directly in the interactive shell — no file needed!

  1. Open your terminal or command prompt.
  2. Type python or python3 and press Enter.
  3. You’ll see a prompt like this: >>>
  4. Now type your code:
>>> print("Hello, World!")
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.

That’s It!

You just wrote and ran your first Python program!