// learn.python
Python for J277
Your step-by-step guide to GCSE Computer Science programming. Each lesson is short, friendly and full of worked examples — work through them in order, and try each idea in your own coding tasks as you go.
Getting started
01
Print & Input
Show things on the screen and ask the user for answers.
02
Numbers & Casting
Do maths in Python, and change a value from one type to another.
03
String Manipulation
Join, reshape and format text.
04
Data Types
The four basic types of value, and how to check them.
Control flow
05
Selection: if / elif / else
Make your program choose what to do.
06
Iteration: While Loops
Repeat code while a condition stays true.
07
Iteration: For Loops
Repeat a block of code once for each item in a sequence.
08
Iteration: For Loops with range()
The same for loop — with range() making the numbers.
Data structures
09
1-D Arrays
Store a whole list of values under one name.
10
2-D Arrays
A grid of values — a list of lists.
11
Nested Loops
A loop inside a loop — perfect for grids.
Subroutines
12
Subroutines: Procedures
Name a block of code so you can reuse it.
13
Subroutines: Functions
Subroutines that send a value back.
Files
14
Text File Handling
Save text to a file and read it back.
15
CSV File Handling
Work with comma-separated data, like a simple spreadsheet.
Algorithms
16
Linear Search
The simplest way to find something in a list.
17
Binary Search
A much faster search — but the list must be sorted first.
Sorting