CodeNest

Your first program

Python programs are just text files that the Python interpreter reads top to bottom. The most useful thing to learn first is how to show output:

print("Hello, World!")
  • print is a function: a reusable piece of code you can call by name.
  • The text in quotes is a string, a sequence of characters.
  • Everything after a # on a line is a comment – Python ignores it, humans read it.

You can call print as many times as you like; each call writes on a new line.

Try it

Change the program on the right so it prints these two lines, then press Run:

Hello, Python!
I am learning to code.

When the output matches, the lesson is marked complete automatically.

Python in-browser · Python 3.13
Next
Loading editor…

Press Ctrl/ + Enter or click Run to see the output here.