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 to output the “Hello World” string in the console:

# A simple program to print Hello World in Python

print ("Hello World")


Hello World

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


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


Hi There! My name is John.


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.