Hello, World!

It is very traditional for every programmer, when starting out, to start with a hello world program.

Create a new file called hello.py and open it up in your text editor of choice (the one you downloaded in the last section).

In this new file, copy and paste this line:

print("Hello, World!")

Let's explain what this does:

  • Print

Print is a function. We give it some text and it'll print it to the screen.

  • "Hello, World!"

Is what we call a string (a string of characters). It's just text.

Now, open up a Terminal, navigate to your directory and run:

python hello.py

_Make sure you use python or python3, whichever one worked for you in the last section.

And you'll see on your screen printed:

$ Hello, World!

Congratulations! You have just run your first Python program! 🥳

Last updated