2. Hello World Program

Learn how to write and execute your very first Python program.

Introduction


The "Hello, World!" program is a classic tradition in computer programming. It is a simple, complete first program for beginners, and it is used to test that your programming environment is properly configured.


In Python, printing text to the screen is incredibly simple. We use the built-in print() function.

# This is a comment in Python. It is ignored by the computer.
# The print function outputs text to the console.

print("Hello, World!")

Try it yourself!


In the example above, the text inside the quotation marks is a string. You can change "Hello, World!" to any text you like, and Python will print it to the screen.