Skip to content

Getting Started with Python: Your First Program

Programming Python Difficulty 1/5

Beginning of the lesson

Getting Started with Python

Your very first program, one friendly step at a time

Big Idea: Python is a language you can use to talk to a computer. With just one short line, print(...), you can make the computer show words on the screen. Today you will run your first real program!
By the end you will be able to:
  • say what Python is and where you type it,
  • use print() to show text and numbers on the screen,
  • understand the interactive prompt (the REPL) and the >>> symbol,
  • write and run the classic first program: Hello, World!

1. What is Python?

Python is a programming language: a special way of writing instructions that a computer can follow. It was designed to be easy to read, almost like simple English, which makes it a wonderful first language.

Analogy: think of the computer as a friendly robot that only speaks Python. If you say the words correctly, it does exactly what you ask. If you say them in the wrong way, it just looks confused and waits. Learning Python is learning how to speak clearly to that robot.

The program that reads your Python and runs it is called the Python interpreter. You type Python, the interpreter reads it line by line, and it makes things happen.

2. The interactive prompt (the REPL)

When you open Python, you often see three arrows: >>>. This is the interactive prompt, also called the REPL. REPL stands for Read - Eval - Print - Loop: Python reads what you type, evaluates (works it out), prints the result, then loops back to wait for the next line.

The >>> is Python saying "I am ready - type something!". You do not type the arrows yourself; Python shows them for you. You just type after them and press Enter.

>>> print("Hello, World!")
Hello, World!
>>> 2 + 2
4
>>> print("Python is fun")
Python is fun

Above, the lines starting with >>> are what a person typed. The lines without arrows are what Python answered back. Notice that 2 + 2 gave 4 right away - that instant answer is the magic of the REPL.

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 15
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers