# Hello World in Python

> Your first Python script, the Hello World program. Why you plan in pseudocode first, and why syntax has to be exactly right.

**Course:** [Programming Basics](https://learn.benibix.com/learn/development-concepts)  
**Time:** 10 min

**After this lesson you can:**

- Write and run a Hello World script
- Plan a program in pseudocode
- Explain why syntax must be exact

## How to write and run your first Python script

The first program most people write is Hello World. It prints the words Hello, world! and stops. In Python it is one line: print("Hello, world!"). A 1978 book on the C language made it the usual first program. It proves your tools work before you try anything harder.

You save that line in a text file whose name ends in .py, such as hello.py. That file is a script: a program that runs straight from its text, with no build step first. You run it by typing python hello.py, and the words appear underneath.

Before you write code, it helps to write the plan in plain words. That plan is called pseudocode. It might say: ask for a name, then say hello to that name. No computer runs pseudocode. It is for you, so you can think about the steps before the rules of a language get in the way.

Code, unlike pseudocode, has strict rules. Those rules are the syntax: which signs go where, and in what order. In Python, text goes inside quote marks and the brackets after print must open and close. Miss one quote mark and Python stops before it runs a single line.

That strictness surprises people. A person reading print("Hello) can guess what you meant. Python cannot guess. It reads the text exactly as written, and it tells you the line where the rules broke. Reading that message is a skill you will use every day.

Python itself is free, and you can get it from python.org. Its creator first shared it in February 1991. The name comes from a British comedy show, not the snake. Today it runs on Windows, macOS and Linux.

The common mistake is to skip the first run. Type the one line, run it, and see the words. When something later goes wrong, you then know the tools were fine and the problem is in your new code.

```python
# hello.py
print("Hello, world!")

# In the terminal:
# $ python hello.py
# Hello, world!
```
One line of code, saved as hello.py and run. The lines that start with # are notes Python skips.

![Three steps left to right. First, pseudocode in plain words: say hello, then stop. Second, a script file hello.py holding print Hello, world. Third, the command python hello.py and the words Hello, world! printed below it.](https://learn.benibix.com/diagrams/dev7-first-program.svg)

### Example: Jack's first script will not run

Jack types print("Hello, world!) and runs it. Python stops at line 1 and reports a problem with the text.

He compares it with the example and finds the missing quote mark after the !. He adds it, runs the file again, and the words appear. The fix took 1 character.

**Words in this lesson:** [Hello World Program](https://learn.benibix.com/term/development/hello-world-program), [Script (Programming)](https://learn.benibix.com/term/development/script), [Pseudocode](https://learn.benibix.com/term/development/pseudocode), [Syntax](https://learn.benibix.com/term/development/syntax)

**Question:** Why does print("Hello) not run in Python?

**Answer:** The closing quote mark is missing, so the syntax is broken. Text must sit between two quote marks. With one missing, the code breaks Python's syntax rules, and no line of the script runs.

---

Source: https://learn.benibix.com/learn/development-concepts/hello-world-in-python
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
