Python Hello World Step by Step Beginner Friendly Tutorial

Logan Jul 13, 2026

Starting your journey with Python can be as simple as learning your first greeting - "Hello, World!". This iconic phrase is the traditional first piece of code programmers learn and creates a fantastic introduction to the world of coding. So, let's dive into Python and create your "Hello, World!" program step-by-step.

PYTHON BASICS: HELLO, WORLD!
PYTHON BASICS: HELLO, WORLD!

Before we commence, ensure you have Python installed on your system. Python's official website offers an easy-to-follow guide for installation, accessible at python.org.

30-Day Python Learning Plan for Beginners | Complete Python Roadmap to Learn Coding Fast
30-Day Python Learning Plan for Beginners | Complete Python Roadmap to Learn Coding Fast

Setting Up Your Python Environment

The first step in our Python journey involves setting up an environment where we can write and run our code. Python provides an integrated development environment (IDE) known as IDLE, which comes pre-installed when you set up Python.

Python Tutorial
Python Tutorial

Alternatively, you can use other popular IDEs such as Visual Studio Code, PyCharm, or Jupyter Notebook that offer more advanced features and better overall user experiences. For this guide, let's use IDLE.

Launching IDLE and Writing Your First Code

Python in Easy Steps
Python in Easy Steps

After installing Python, launch IDLE from your Start menu (Windows) or Applications folder (macOS/Linux). When IDLE opens, you'll see a white window with a flashing cursor. This is where we'll write our "Hello, World!" program.

To write our code, type the following lines exactly as shown:

print("Hello, World!")

30-Day Python Learning Roadmap for Beginners | Step-by-Step Coding Plan 2026
30-Day Python Learning Roadmap for Beginners | Step-by-Step Coding Plan 2026

Running Your First Python Script

To run our script, we need to save it first. Press Ctrl + S (Windows) or Cmd + S (macOS) and choose a location to save your file. Name it "hello_world.py" (the .py extension is standard for Python scripts).

Now, let's run our script by pressing F5 or clicking on Run β†’ Run Module in the menu bar. You should see the phrase "Hello, World!" printed in the IDLE window below your code.

Python Hello World program | python tutorial for freshers and experienced #python| Harisystems
Python Hello World program | python tutorial for freshers and experienced #python| Harisystems

Understanding print() Function

The print() function in Python is used to output or display data. When we call print("Hello, World!"), we're asking Python to display the text inside the quotation marks.

How to Make a Chatbot in Python β€” A Step-by-Step Guide with Source Code
How to Make a Chatbot in Python β€” A Step-by-Step Guide with Source Code
Python Cheat Sheet for Beginners 2026 | Python Basics, Syntax, Loops, Functions & Variables
Python Cheat Sheet for Beginners 2026 | Python Basics, Syntax, Loops, Functions & Variables
9 Python Projects for Beginners (Build Your Portfolio Fast)
9 Python Projects for Beginners (Build Your Portfolio Fast)
Hello World: Your First Step in Programming Success πŸ‘‹
Hello World: Your First Step in Programming Success πŸ‘‹
Python Learning Path for Beginners 2026 πŸš€
Python Learning Path for Beginners 2026 πŸš€
30 Python Projects For Beginners and Advanced Learners (2023)
30 Python Projects For Beginners and Advanced Learners (2023)
Python Beginner Roadmap 2026: Learn Python Step-by-Step From Zero to Job Ready
Python Beginner Roadmap 2026: Learn Python Step-by-Step From Zero to Job Ready
Python Projects Ideas For Beginners
Python Projects Ideas For Beginners
Python to_timestamp Easiest Way to Implement with Examples
Python to_timestamp Easiest Way to Implement with Examples
All Important Python Functions for Beginners (Complete Cheat Sheet)
All Important Python Functions for Beginners (Complete Cheat Sheet)
the top 50 python project ideas
the top 50 python project ideas
Shortcut to learn Python.[Cheatsheet]
Shortcut to learn Python.[Cheatsheet]
Master Python Methods: A Quick Guide for Beginners!
Master Python Methods: A Quick Guide for Beginners!
How to Set Up Python on Windows – Step 2: Verify Installation (Beginner Friendly!)
How to Set Up Python on Windows – Step 2: Verify Installation (Beginner Friendly!)
Learn Python Online (2022): 22 Best Python Courses and Tutorials For Beginners
Learn Python Online (2022): 22 Best Python Courses and Tutorials For Beginners
🌟Learn Python: Your Ultimate Guide to Mastering Python Programming  Step-by-step guide to learn
🌟Learn Python: Your Ultimate Guide to Mastering Python Programming Step-by-step guide to learn
Learn Python the Right Way in 5 Steps
Learn Python the Right Way in 5 Steps
python Hello World | GUI mode
python Hello World | GUI mode

This function is handy for outputting variable data, such as user input or calculations. For example, calling print(2 + 3) would display 5 as output.

print() Function with Variables

Let's use a variable to enhance our "Hello, World!" example. In your "hello_world.py" file, alter the code to:

greeting = "World"
print("Hello, " + greeting)

variables in Python store data values, and we can concatenate (join) string variables using the plus sign (+). Run your script again, and it should display Hello, World! using the variable you defined.

Handling Multiple print Statements

Python executes print statements sequentially, so multiple print statements will display output on separate lines. Add the following lines to your "hello_world.py" file after the existing code:

print("How are you?")
print("I hope you're doing well.")

When you run your script, you'll see each message displayed on a new line.

Congratulations, you've successfully written and executed your first Python program! The world of Python is vast and filled with endless possibilities. Starting with the basics, like greeting the world, is the perfect beginning to your coding adventure. Now that you've taken the first step, let's look forward to exploring more Python features and building more exciting projects together.