Python Program to Print Hello World

python-program-to-print-hello-world

This is a Python code example that will show you how you can print “Hello World” in Python. Also, the same method is applicable for any string that you want to print out in Python.

Print() Function

To print the string “Hello World”, we will make use of the print() function that is available by default in Python.

Here is the python program that uses the print() function to print “Hello World”:

# A simple program to print Hello World in Python

print ("Hello World")

Output:

Hello World

In a similar fashion, you can print any string in Python by using the print() function.

Example:

print ("Hi There! My name is John.")

Output:

Hi There! My name is John.

Takeaway

In this Python example, we printed the string “Hello World” by using the print() function in a Python program. Also, the same can be used to print any string within a Python program.