Lesson 2: What Is Python, and Installing It


What you'll learn in this lesson


What Python is

Python is a programming language: a way of writing instructions that looks much like plain English. It is called a high-level language because it sits far above the numbers the computer really runs on — you write words like print and name, and Python handles the translation. A low-level language, by contrast, forces you to manage tiny details yourself. High-level means easier for humans, and that is exactly what a beginner wants.

Python is also interpreted, which means Python reads and runs your code one line at a time, right away. You do not have to wait for a separate "build" step before seeing a result. Type a line, press Enter, see what happens. That instant feedback is a big part of why Python is friendly to learn.

Python 3 is the current version of the language. Older Python 2 is out of date, so everything in this course uses Python 3. When a tutorial just says "Python" with no version number, assume it means Python 3.


Download Python from python.org

Python is free. You download it from its official website, python.org:

  1. Open your web browser and go to python.org.
  2. Click Downloads and choose the installer for your system (Windows, macOS, or Linux).
  3. Download the installer file and run it.

Do not download Python from anywhere else. The official site always has the current, safe version.


Install it on your system

Windows: Python gives Windows users two ways to install it. Option A is the one the Python team recommends, so start there. Use Option B only if A doesn't work on your computer.

Option A: The Python install manager (recommended)

  1. Open your browser and go to python.org/downloads.
  2. Choose the Windows download. It is labeled "Python install manager."
  3. Open the downloaded file and follow the prompts. If you prefer, you can instead open the Microsoft Store app on your PC, search for Python Install Manager, and click Install.
  4. The first time it runs, a quick setup check may appear. Let it finish and follow what it asks.

There is no "Add to PATH" box with this method, and you don't need one. It comes with Python 3 and IDLE.

Option B: The traditional installer

Use this if you can't use the Microsoft Store or the install manager.

  1. Download the Windows installer (the .exe file) from python.org.
  2. Double-click it. On the very first screen, tick "Add python.exe to PATH" before you click anything else.
  3. Click Install Now and wait.
  4. When you see "Setup was successful," click Close. If it offers "Disable path length limit," you can click it or skip it. Either is fine for this course.

Mac: Run the downloaded macOS installer and follow the steps. It installs Python and IDLE together. After installing, you can check your work in the Terminal app, but you do not need the Terminal for this course — IDLE is enough.

Linux: Python 3 is usually already installed. If it is not, use your system's package manager (for example, sudo apt install python3 on Ubuntu). IDLE can be installed the same way if it is missing.

You do not need to install anything else for this course. No paid software, no extra tools, and no accounts are required. Python and IDLE are everything.


Can't install Python on your computer?

That's okay. Many school and work computers don't allow new programs, and Chromebooks can't run the Windows installer. You can still learn Python in this course. Use the in-browser Python runner, which runs real Python in your browser with nothing to install. Type the same lines you'd type in IDLE. You can type and run the short lines from Lessons 2–15 in the runner — print, variables, numbers, strings, comparisons, if statements, loops, lists, dictionaries, and functions. Saving practice files needs IDLE, and so does Turtle drawing in Lesson 11, so install Python on your own computer when you can. If you can install later, come back to this lesson and try again.


If something goes wrong

I can't find IDLE. Click Start and type IDLE, not "Python." If it isn't there, restart your computer once and try again. Also check Settings > Apps for an entry named Python.

Windows says "Windows protected your PC." Click More info, then Run anyway, but only if you downloaded the file from python.org.

The installer asks for an administrator password, or says you don't have permission. You're probably on a work or school computer that blocks installs. Use the in-browser runner above.

The installer won't start, or says it can't run on your PC. The install manager needs Windows 10 or later. On an older version, use the in-browser runner.

Typing python in Command Prompt opens the Microsoft Store or says "Python was not found." You don't need the Command Prompt for this course, so just open IDLE from the Start menu. If you installed with Option B and want to fix it, run the installer again, choose Modify, then Repair, and make sure the PATH box is ticked.

IDLE opens, but print("Hello, Python!") gives an error. The usual cause is the quotes. If you copy the line from a Word document or email, the quotes may become curly (“ ”), and Python only accepts straight ones (" "). Type the line yourself, or copy it from this page.

I have more than one Python installed. That's fine. Any version that starts with 3 works for this course.


Open IDLE

IDLE is the small programming tool that comes bundled with Python itself. It has two jobs in this course: it gives you a window where you can type Python lines and see results at once (called the shell), and it lets you write and save program files.

To open it:

You should see a window titled "IDLE Shell" with a prompt that looks like >>>. That prompt is Python waiting for your first instruction.


Check that it works

In the IDLE shell, type this line and press Enter:

print("Hello, Python!")

Output:

Hello, Python!

If you see Hello, Python! printed back, your installation works and you are ready. If IDLE does not open or the line gives an error, check two things: that you installed Python 3 (not Python 2), and that you typed the line exactly, quotes and all.

You can also check the version. In the shell, the first lines IDLE prints when it opens include the Python version number. As long as it starts with 3, you are set — the exact number after that does not matter for this course.


Hands-on exercise

  1. Install Python 3 with the install manager (Option A). If you use the traditional installer instead, tick "Add python.exe to PATH" on its first screen.
  2. Open IDLE and confirm you see the >>> prompt.
  3. In the shell, print your own name in quotes.
  4. Print the result of 10 + 5 in the shell and check you get 15.

Quick quiz

  1. What does "high-level language" mean?
  2. What does "interpreted" mean for Python?
  3. What is the official website to download Python from?
  4. If you install with the traditional installer (Option B), what box must you tick on the first screen, and why?
  5. What is IDLE, and what are its two jobs in this course?

Answer key: 1. A language that lets you write readable words instead of managing tiny computer details yourself. 2. Python reads and runs your code one line at a time, right away. 3. python.org, the official site. 4. "Add python.exe to PATH" — only if you use the traditional installer (Option B); without it, the computer may not find Python later. 5. The tool bundled with Python; it gives you an interactive shell and lets you write and save program files.


Key takeaways

Next lesson: Your First Program.


Slides

Work through the slides with Helio's narration, or download them:

Open the slidesDownload PowerPointDownload PDF

Try it yourself

Run the lesson's example with real Python, right in your browser (Python loads from the internet, so you need to be online).

Open the demo

Practice file

Download lesson02-practice.pyDownload the solution

# Lesson 2: What Is Python, and Installing It
# WHAT TO DO: This is your first program file. Line 9 is unfinished:
# replace the placeholder words inside the quotes with your own name.
# HINT: Only change the words inside the quotes. Do not touch the
# print part or the quotes themselves.
# Run with F5 in IDLE. You are done when line 2 prints your real name.

print("Hello, Python!")
print("My name is TODO - put your name here")  # <-- CHANGE THIS LINE
print(10 + 5)

Save the file as lesson02-practice.py and run it with F5 in IDLE. On a Mac, if F5 does nothing, use Run, then Run Module, from the menu.

Check yourself

Five quick questions on this lesson. Take the Lesson 2 quiz

Want graded quizzes and progress tracking?

Enroll free in the full course — same 17 lessons, with your progress saved. Free, no payment.