Hello World Program in Python

In this article, you will learn to write First Python Program and also take a look at Python IDLE.

Start with the first Python program – Let’s create or write a very simple program called Hello World. A “Hello, World!” is a simple program that outputs Hello, World!

Since it’s a very simple program, it’s often used to introduce a new programming language to beginners.

Type the following code in any text editor such as VS code or an IDE and save it as hello_world.py or with any name which suits you right but the file extension will be (.py).

print("Hello, World!")

print() function in Python is a function that allows Python to display output in the Terminal or Python Console.

Hello World Program

After running it, you will get the following output.

Note: If VS Code is not installed yet, then install it from Visual Studio Code

Congratulations! You have executed your first program in Python. As you have done your first program in Python, you have entered the world of programming.

As you can see that is how easy the task was. So, this is the beauty of Python language which let you do programming in just fewer lines.

The Python IDLE – To test or write short and few lines of code in Python is pretty simple and for that, we don’t need to use any kind of text editor, it can be easily done in IDLE. It is because Python can be run as a command line itself.

Let’s write “Hello, World!” in the IDLE:

Print(“Hello World”)
Hello World Program

After running it, you will get the following output.

From there you can write short lines of code including our first program (Hello, World!).

When you are done with executed code in the command line, you can easily quit the Python command line interface or come out from it by the following type:

Hello World Program

Click to read Introduction to Python

Connect on:

Recent Post

Popular Post

Top Articles


Share on