Python FunctionsPython Functions1

Python Exception HandlingPython Exception Handling1

Python Hello World Program



Visualization

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.

What You Will Learn

Your First Python Program

Type this line exactly as it is:

print("Hello, World!")

What Does This Mean?

How to Run This Program (Using a File)

  1. First, you need Python installed on your computer. Download it from python.org.
  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)
  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!")

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.

That’s It!

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!



Welcome to ProgramGuru

Sign up to start your journey with us

Support ProgramGuru.org

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

PayPal

UPI

PhonePe QR

MALLIKARJUNA M