Hello World Program in PythonLast Updated : 3 Jan 2026 In this section, we will learn how to write the simple program of Python to print the classic "Hello, World!" on the console. Python Hello World ProgramHere's the "Hello, World!" program: ExampleExecute NowOutput: Hello, World! Code Explanation![]() In the above snippet of code, we have used print(), a built-in function in Python, to display output to the user. "Hello, World!" is a string literal. It's the text we want to display, enclosed within double quotes. The print() function takes this string as input and displays it. Things to Remember While Writing First Python ProgramThe following are few key concepts to remember while writing programs in Python:
Different Ways to Print "Hello, World!" in Python1. Using a User-defined FunctionIn this example, we are defining our own function and printing Hello, World! from inside it. ExampleExecute NowOutput: Hello, World! 2. Using String Assignment and PrintIn this example, we are first storing the message in a string variable and then printing it. ExampleExecute NowOutput: Hello, World! ConclusionIn the following tutorial, we have learned the use of print() function to print a simple statement: "Hello, World!". We have discussed various key points to remember while writing programs in Python. We have also looked at some more examples of Python illustrating the use of print() function. Next TopicHow to Install Python |
We request you to subscribe our newsletter for upcoming updates.