No history yet

Introduction to Python

Meet Python

Python is a programming language, which is just a way to give instructions to a computer. What makes Python special is its simplicity. Its commands are designed to look a lot like plain English, which makes it one of the easiest languages for beginners to learn.

It was created in the late 1980s by a Dutch programmer named Guido van Rossum. Since then, it has grown to become one of the world's most popular languages. It's used for everything from building websites and creating video games to analyzing scientific data and powering artificial intelligence.

Lesson image

Setting Up Your Workspace

To start writing Python, you need two things: the Python interpreter itself, which understands your code, and an Integrated Development Environment (IDE), which is a program that makes writing code easier. For beginners, a great choice is an IDE called Thonny because it comes with Python already built in.

Here’s how to get it set up:

  1. Go to the official Thonny website (thonny.org).
  2. Find the download link for your operating system (Windows, Mac, or Linux) and click it.
  3. Once the download is complete, open the installer and follow the on-screen instructions. The default settings are perfect for getting started.

That's it. Once installed, opening Thonny will give you a clean, simple interface ready for your first program.

Lesson image

Your First Program

In the world of programming, it's a long-standing tradition to make your first program display the message "Hello, World!". This simple task confirms that your setup is working correctly and gives you a feel for the language's basic syntax.

In Thonny, you'll see a large empty area for writing code. Type the following line exactly as you see it here:

print("Hello, World!")

Let's break that down. print is a built-in Python function that tells the computer to display text on the screen. The text you want to display goes inside the parentheses () and must be wrapped in quotation marks "".

To run your program, click the green 'Run' button (it looks like a play symbol) on the Thonny toolbar. Thonny will ask you to save the file first. Name it something simple like hello.py and save it to your computer.

After saving, you should see the words Hello, World! appear in a panel at the bottom of the Thonny window called the 'Shell'. Congratulations, you've just written and run your first Python program.

Now that you've got the basics down, let's test your understanding.

Quiz Questions 1/5

What is the primary reason Python is considered a good programming language for beginners?

Quiz Questions 2/5

What is Thonny?

With setup complete and your first program running, you're ready to explore what else Python can do.