Coding: Python Basics

KS3 computing: variables, input, loops, conditionals and tracing your first Python programs on paper.

Also in the Secondary Skills Bundle (50 pages, £11.99)

Or included with a Flybrite membership, along with all 870 printables.

Your First Program printable preview
No. 851Ages 11 to 14

Your First Program

How print() puts words on the screen, taken apart piece by piece, with a first program, its output and predict-the-result practice.

Variables printable preview
No. 852Ages 11 to 14

Variables

Named boxes that store values, the difference between assign and equals, the naming rules, and four trace-the-value questions.

Input and Output printable preview
No. 853Ages 11 to 14

Input and Output

Reading what the user types with input() and why it always comes back as text, plus converting with int() to do maths.

Data Types printable preview
No. 854Ages 11 to 14

Data Types

The four types you meet first, int, float, str and bool, with a casting table and why 42 and "42" are not the same thing.

If Statements printable preview
No. 855Ages 11 to 14

If Statements

Selection with if, elif and else, the comparison operators, and how indentation decides what belongs to each branch.

For Loops printable preview
No. 856Ages 11 to 14

For Loops

Repeating a set number of times with for and range(), a worked total, and how to read range() including its step.

While Loops printable preview
No. 857Ages 11 to 14

While Loops

Repeating while a condition holds, when to choose while over for, and the infinite loop that a missing update creates.

Lists printable preview
No. 858Ages 11 to 14

Lists

Storing many values in order, why indexes start at zero, and the everyday operations len, append and negative indexing.

Functions printable preview
No. 859Ages 11 to 14

Functions

Defining reusable blocks with def, passing values in through parameters, and handing a result back with return.

Debugging and Trace Tables printable previewType or write in
No. 860Ages 11 to 14

Debugging and Trace Tables

Run code by hand in a trace table to see exactly what it does, with a worked example, a write-in table and a full answer key.

More packs