Python Programming Fundamentals
Python Setup
Getting Your Tools Ready
Before you can start writing Python code, you need two things: the Python language itself and a place to write it. Think of it like cooking. You need the ingredients (Python) and a kitchen to work in (your code editor).
First, let's get Python. It's a free, open-source programming language. You can download it directly from the official Python website, python.org. The site automatically detects your operating system, whether it's Windows, macOS, or Linux, and suggests the right version to download.
When you run the installer, make sure to check the box that says "Add Python to PATH." This small step makes it much easier to run your code from anywhere on your computer. It's like telling your computer exactly where to find the Python 'ingredients' without having to look them up every time.
Your Coding Workshop
Once Python is installed, you need a program to write and manage your code. While you could use a simple text editor like Notepad, it's much easier to use a tool designed specifically for coding. This is where an Integrated Development Environment, or IDE, comes in.
IDE
noun
An Integrated Development Environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools, and a debugger.
An IDE is like a fully equipped workshop for a programmer. It has a text editor with features like syntax highlighting, which colors your code to make it easier to read. It also includes tools to run your code and help you find errors, called 'bugs'.
For beginners, a great choice is Thonny. It's a simple, lightweight IDE designed for learning Python. It comes with Python built-in, so you don't have to worry about complex setup. You can download it for free from thonny.org.
Writing Your First Program
With Python and Thonny installed, you're ready to write your first program. It's a tradition in programming to start with a simple program that just prints the text "Hello, World!" to the screen. This confirms that everything is set up and working correctly.
Open Thonny. You'll see a text editor at the top and a 'Shell' at the bottom. The editor is where you write your code files. The shell is where you'll see the output of your programs.
In the editor, type the following line of code:
print("Hello, World!")
Now, save the file. Go to File > Save As and name it something like hello.py. The .py extension is important—it tells the computer that this is a Python file.
To run your program, just click the green 'Run' button (it looks like a play symbol). You should see the text Hello, World! appear in the shell at the bottom of the window.
Congratulations! You've just written and executed your first Python program. This simple step is the foundation for everything else you'll learn.
Now you have a complete Python development environment set up. You're ready to start exploring the language and building more complex programs.
Ready to check your understanding of the setup process?
What are the two essential components you need to begin programming in Python?
When installing Python on Windows from the official installer, which checkbox is crucial for making it easier to run Python from your computer's command line?

