Programming Basics with Python
Free, beginner-friendly short video lessons, quizzes, and browser-based Python practice, with no previous experience required.
Resume lessonWhat programming is
Understand what a computer program is and how a computer executes instructions.
Watch What programming is
A computer program is a collection of instructions that performs a task. Code is instructions written using a programming language. Running a program means the computer carries out its instructions in order, from top to bottom. Output is the information or result produced by a program.
Creator-supplied reference narration
What is programming? A program is a set of instructions that tells a computer what to do. Imagine you're giving someone instructions to make a cup of coffee. 1. Get a cup. 2. Put coffee in the cup. 3. Add hot water. 4. Stir the coffee. Those are instructions. If someone follows them in order, they end up with a cup of coffee. Programming works in a similar way. Instead of giving instructions to another person, we're giving instructions to a computer. Let's look at a small program written in Python. Our first instruction tells the computer to display the word "Hello!" Our second instruction tells the computer to calculate two plus three and display the result, which is five. And our third instruction tells the computer to display "Goodbye!" The computer executes these instructions in order, from top to bottom. When we run the program, we can see the results displayed on the screen. Now, here's another simple example. We have two instructions. The first displays the word "First," and the second displays "Second." When we run the program, that's exactly what we get. But what happens if we reverse the order of those instructions? Now "Second" appears before "First." The instructions haven't changed. We've simply changed their order, and the output changes accordingly. Before we finish, there are four important programming terms to remember. Code is the instructions we write using a programming language. Program is a collection of instructions organized to perform a task. Execute, or run, means the computer carries out those instructions. Output is the information or result produced by the program. That's the basic idea behind programming. Programming is telling a computer what to do by giving it instructions it can execute. Now, let's test what you've learned with a short quiz.
Quiz
Answer each question correctly. You can try again as often as you like.
The 12 lessons
-
1
Available
What programming is
How a sequence of instructions produces a result.
-
2
Available
Writing Your First Python Program
Write and run simple Python instructions using print(), then change the output.
-
3
Coming soon
Variables and values
Giving a value a name so it can be used later.
-
4
Coming soon
Strings, numbers, and booleans
Text, numeric, and true/false values in Python.
-
5
Coming soon
Expressions and operators
Combining values and operators to produce a result.
-
6
Coming soon
Comparisons and if statements
Comparing values and choosing which instructions run.
-
7
Coming soon
for loops
Repeating instructions for each item in a sequence.
-
8
Coming soon
while loops
Repeating instructions while a condition remains true.
-
9
Coming soon
Lists and indexes
Keeping values in a list and finding them by position.
-
10
Coming soon
Functions and parameters
Grouping instructions and passing values into them.
-
11
Coming soon
Errors and debugging
Reading errors and finding the cause of a problem.
-
12
Coming soon
Bringing the basics together
A small challenge that combines the course fundamentals.
How it works
Watch a short lesson, check what you understood, then practise in Python when there is an exercise. Move through the lessons at your own pace.