Python – Hello World

Hello World Program

Hello World is a classic program that majority of the learners of any programming language start with. It is to print a message Hello World! to the output.

Python - Hello World

In the following program, we print the message ‘Hello World!’ to the console output, using print statement.

Python Program

print('Hello World!')
Run Code Copy

As simple as that, we get the message printed to the console output.

Click on the Run button below the program, to run the Python code online in a new tab.

We can have the above code in a Python file, say main.py, and run as shown in the following using python command.

Python - Hello World - Terminal Output

Or, run the code (print statement) as is in a Python terminal as shown in the following.

Python - Hello World - Shell Output

Frequently Asked Questions

1. How do you write 'Hello, World' in Python?

Answer:

You can use python() built-in function to print 'Hello, World' to standard output in Python.

print('hello world')
2. Which function is used to print a string in Python?

Answer:

python() built-in function can be used to print a string in Python. python() function takes the string as argument, and prints the given argument string to standard output.

print('hello world')
print('hello user')

Related Tutorials

Code copied to clipboard successfully 👍