Your First Program
5 min · Python
Write and run your very first lines of Python, right here on the page.
Enemy 1 of 5
Every program, no matter how big, is just a set of instructions a computer follows one after another. The simplest instruction you can give is: show me a message. That's exactly where every programmer starts, and it's a tradition that goes back decades — the very first line of code most people write in a new language prints the words "Hello, World!" to the screen.
In Python, you show a message with print. print is a built-in function — a small, ready-made tool that already knows how to do one job (in this case, writing text to the screen) so you don't have to build that ability yourself. You put the text you want to show inside parentheses, and you wrap it in quotes so Python knows it's literal text and not something else it should try to interpret as code.
Press Run below to see what happens. The output panel shows exactly what your program printed — this is the same loop you'll repeat for every exercise in this course: read the code, predict what it will do, then run it and check.
Loading editor...