Print "Hello, World!"

Your very first Python program that prints "Hello, World!" to the screen.

PythonBeginner

What You'll Learn

  • How to write and run your first Python program
  • Using the built-in print() function
  • Understanding basic string output
Python
# The classic first Python program
print("Hello, World!")

Output

Hello, World!

Print "Hello, World!" in Python

This is the traditional first program you write in any language. It helps you verify that Python is installed and working correctly on your system.

print() function

  • print() is a built-in Python function used to display output on the screen.
  • Whatever you pass inside the parentheses is printed.
  • Text (string) values must be written inside quotes (single or double).

How it works

  1. Python reads the line print("Hello, World!").
  2. The string "Hello, World!" is passed as an argument to print().
  3. Python sends this text to the standard output (your terminal or console).

This single-line program introduces:

  • Python's simple and clean syntax
  • How to run a script
  • How to display information to the user

Key Takeaways

1
print() is used to display output
2

Strings must be enclosed in quotes

3

Python syntax is simple and readable

4

This is the foundation for all Python programs

Step-by-Step Breakdown

  1. 1Open a file named hello.py (or use a Python REPL).
  2. 2Write the line: print("Hello, World!")
  3. 3Run the file using: python hello.py
  4. 4Observe the output printed in the terminal.