Hello World Program
Write and understand your first program
Our First Program — Hello World Program
In this section, we will write our very first Python program.
Here is a simple program in the Python programming language that displays the phrase Hello World on the screen:
As you can see, Python only needs a single line. Let's break it down.
The print Function
print is a built-in Python function that outputs text to the screen. To use it, you write the function name followed by parentheses. Inside the parentheses, you pass the text you want to display.
Strings
The text "Hello World!" is called a string — a sequence of characters wrapped in quotes. You can use either double quotes " or single quotes ' in Python:
Both lines produce exactly the same output. You will learn more about strings in a later module.
This program is the simplest possible example of Python in action. Despite its simplicity, it already demonstrates some of Python's core philosophy: code should be readable, concise, and straightforward.