The Wayback Machine - https://web.archive.org/web/20241225113747/https://www.geeksforgeeks.org/python-program-to-print-hello-world/
Open In App

Python Program to Print Hello World

Last Updated : 28 Nov, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

When we are just starting out with Python, one of the first programs we’ll learn is the classic “Hello, World!” program. It’s a simple program that displays the message “Hello, World!” on the screen.

Here’s the “Hello World” program:

Python
print("Hello, World!")

Output
Hello, World!

How does this work:

print-hello-world

Hello World


  • print() is a built-in function in Python that tells the program to display something on the screen. We need to add the string in parenthesis of print() function that we are displaying on the screen.
  • “Hello, World!” is a string text that you want to display. Strings are always enclosed in quotation marks.

There are two more ways to print the same string “Hello World” :

Python
# Using Single Quote
print('Hello World')

# Using Triple Quotes
print('''Hello World''')

Both the above methods work same as the first method that is the double quotes method.

Try it Yourself:

Try printing your name following the same steps as given above. Use all the three methods to print your name.

Python
# Edit this code and try to print Your Name
print()




Next Article

Similar Reads

Practice Tags :
three90RightbarBannerImg