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.
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")
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.
Hi! I am Pankaj, a full-time content specialist and a part-time programmer and marketer. I love to explore new places and also new ideas. I am an inquisitive person with a passion to learn new skills through every possible opportunity that comes in the way.