No history yet

Introduction to Python

What is Python?

Python is a programming language, which is a way to give instructions to a computer. Think of it like a recipe. A recipe gives a chef a set of steps to create a dish; a programming language gives a computer a set of steps to complete a task.

What makes Python special is its readability. The rules and syntax are designed to be clean and straightforward, almost like reading English. This makes it a fantastic language for beginners who are just starting their coding journey. It was created in the late 1980s by a programmer named Guido van Rossum, who wanted to make a language that was both powerful and easy to learn.

Today, Python is used almost everywhere. It powers parts of Instagram and Netflix, helps scientists analyze data from space, and is the go-to language for artificial intelligence and machine learning. From building websites to automating repetitive tasks on your computer, Python's versatility makes it one of the most popular programming languages in the world.

Getting Python on Your Computer

Before you can start writing Python code, you need to install it on your computer. While some operating systems come with an older version of Python, it's always best to install the latest version to get all the new features and security updates.

The process is simple. You can download the official Python installer directly from the Python Software Foundation's website, python.org. When you run the installer, it will guide you through a few steps. It's a good practice to check the box that says "Add Python to PATH" during installation, as this makes it easier to run Python from anywhere on your computer.

Lesson image

Your Coding Toolkit

You could write code in a simple text editor, but most programmers use an Integrated Development Environment, or IDE. An IDE is a software application that combines all the tools you need for programming into one place. It typically includes a text editor for writing your code, tools for running it, and features that help you find and fix errors.

IDE

noun

An acronym for Integrated Development Environment, a software application that provides comprehensive facilities to computer programmers for software development.

For beginners, we recommend an IDE called Thonny. It’s designed specifically for learning to code. The user interface is simple and uncluttered, and it comes with Python already built-in, so you don't have to worry about a complicated setup. When you install Thonny, you're installing both a great learning tool and Python itself.

Lesson image

When you open Thonny, you'll see two main areas. The top part is the editor, which is where you'll write and save your Python scripts. The bottom part is the Shell, where you can type single lines of code and see immediate results. It's also where the output of your scripts will appear when you run them.

Let's write our very first program. In the editor at the top, type the following line:

print("Hello, Python!")

Now, click the green "Run" button (it looks like a play symbol). Thonny will ask you to save the file first. Save it as hello.py. Once you save it, you’ll see the text Hello, Python! appear in the Shell below. You've just written and run your first computer program!

Quiz Questions 1/6

What is a key characteristic that makes Python a popular choice for beginners?

Quiz Questions 2/6

An Integrated Development Environment (IDE) is best described as:

You've taken the first big step into the world of programming. You now know what Python is, how to install it, and how to use a simple IDE to write your first line of code.