Introduction to Python Programming
Python Installation
Getting Python on Your Computer
Before you can start writing Python code, you need to install it. While some computers come with a version of Python, it's often outdated. It's always best to install the latest version directly from the source.
Go to the official Python website, python.org, and download the installer for your operating system (Windows or macOS). When you run the installer, there's one crucial step: on the first screen, make sure you check the box that says "Add Python to PATH" or "Add python.exe to Path". This tells your computer where to find Python, which will save you a lot of trouble later.
Otherwise, just click through the installer accepting the default settings. Once it’s finished, Python is ready to go.
Your Coding Workspace
Now that Python is installed, you need a place to write your code. You could use a simple text editor, but most programmers use an Integrated Development Environment, or IDE. An IDE is like a text editor on steroids. It combines a text editor with other helpful tools, like a way to run your code and check for errors, all in one application.
There are many IDEs out there, but we'll start with one called Thonny. It’s designed specifically for beginners. It's simple, clean, and comes with Python built-in, so everything just works. You can download it for free from thonny.org.
When you open Thonny, you’ll see two main parts. The large area at the top is the editor. This is where you'll write and save your Python programs, which are also called scripts. The area at the bottom is called the shell. It's a place to run quick commands and see the output of your scripts.
The Interactive Shell
The shell is one of the most useful tools for learning Python. It lets you type in a single line of Python code and see the result instantly. This is great for experimenting and testing small ideas without having to write a full program. You'll know you're in the shell when you see the >>> prompt.
Try it out. In the Thonny shell, type the following and press Enter:
print("Hello from the shell!")
The shell should immediately print Hello from the shell! back to you. You can also use it as a powerful calculator.
25 * 4 + 10
Press Enter, and it will give you the answer: 110. While the shell is great for quick tests, you'll write your actual programs in the editor. In the editor window at the top of Thonny, type this:
name = "Ada Lovelace"
print("Hello,", name)
Now, save the file (you can name it hello.py). To run the program, click the green "Run" button in the toolbar. The output, Hello, Ada Lovelace, will appear in the shell below. You've just written and run your first Python script!
Now let's check your understanding of these first steps.
When installing Python on Windows from python.org, what is the most crucial checkbox to select on the first screen?
What is the primary advantage of using an Integrated Development Environment (IDE) like Thonny over a simple text editor?
You now have a complete Python development environment set up on your computer. You're ready to start exploring the language.

