Second Form Computing โ enter the class password
Work through each section, test yourself, then practise with flashcards.
Broke Nazi Enigma codes in WW2. Father of computer science & AI.
Invented the World Wide Web (WWW) in 1989. Made it free for all.
Created Boolean logic (AND, OR, NOT) โ the foundation of all computing.
| Year | Event |
|---|---|
| 1840s | Charles Babbage designs the first mechanical computer concept |
| 1854 | George Boole invents Boolean logic |
| 1940s | Alan Turing breaks the Enigma code; first electronic computers built |
| 1989 | Tim Berners-Lee invents the World Wide Web at CERN |
| 1990s | Internet becomes public; personal computers in homes |
| 2000s+ | Smartphones, AI, cloud computing, social media |
Encryption = scrambling data so only the intended person can read it.
"Hello Alice"
readable message
"Xq#7!pL2"
scrambled & secure
"Hello Alice"
readable again
| Key | What it does |
|---|---|
| Public key | Shared with everyone โ used to lock (encrypt) the message |
| Private key | Kept secret by the owner โ used to unlock (decrypt) the message |
| Why useful? | You can send secure messages without ever sharing a secret key โ no risk of it being intercepted |
| Concept | Description |
|---|---|
Variable | Named store for a value, e.g. score = 0, lives = 3 |
if / elif / else | Selection โ runs different code depending on a condition |
while loop | Repeats as long as a condition is true |
for loop | Repeats a set number of times |
def / function | Named block of reusable code |
print() | Outputs text to the screen |
input() | Asks the user to type something |
int() | Converts a string to a whole number |
What does this print?
score (7) is > 5, so the if branch runs โ prints "Win"
What is the value of count?
Loop runs 3 times, adding 5 each time: 0 โ 5 โ 10 โ 15
if/loop must be indented โ Python uses spacing as part of its rulesif, for, or whileif score > 5 โ missing the colon at the endif score > 5: โ the colon after if/for/def/while is requiredif score = 10: โ single = assigns, doesn't compareif score == 10: โ double == compares valuesage = input("Age: ") then doing maths โ input is a stringage = int(input("Age: "))A simple game in Python:
while lives > 0 โ keeps the game running until lives run outif/elif handles a different eventlives = 3, score = 0
score = 4. The code checks if score > 5 with an else branch. What prints?
if condition is false. The else branch runs and prints "Lose".
for i in range(3) and adds 5 each time, starting from count = 0. What is the final value of count?
while loop and a for loop?
range().
lives and score?
if score = 10:?
= is assignment. To compare values you need ==. Correct: if score == 10:.
while loop in a game, what must happen?
Thousands of examples fed in
Learns patterns by trial & error
Makes decisions on new data
The reinforcement learning loop:
repeats millions of times
| Benefits | Risks |
|---|---|
| Diagnoses diseases from scans faster than humans | Biased decisions if training data is unrepresentative |
| Powers search engines, auto-correct, voice assistants | Deepfakes and misinformation spread more easily |
| Automates dangerous or repetitive tasks | Jobs displaced; privacy concerns with mass data use |
| Term | Definition |
|---|---|
| AI | System that makes decisions or predictions โ simulates human-like thinking |
| Training data | The examples the AI learns from โ quality matters enormously |
| Bias | Unfair or inaccurate results caused by unrepresentative training data |
| LLM | Large Language Model โ predicts likely next words to generate text (e.g. ChatGPT) |
| Algorithm | A set of step-by-step instructions a computer follows to solve a problem |
Output is 1 only if BOTH inputs are 1
Output is 1 if AT LEAST ONE input is 1
Flips the input: 0 โ 1 and 1 โ 0
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| A | B | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
| Input | Output |
|---|---|
| 0 | 1 |
| 1 | 0 |
| Gate | Real-world example |
|---|---|
| AND โ security door | Opens ONLY if both keycard AND PIN are correct. Both must be 1. |
| OR โ alarm system | Triggers if the door OR the window sensor detects movement. Either can be 1. |
| NOT โ toggle switch | If light is ON (1), NOT flips it to OFF (0). Pressing again flips back. |
| Command | Effect |
|---|---|
forward | Move straight ahead โ set speed and time/distance |
turn_left / turn_right | Rotate the robot โ angle determines turn amount |
stop | Halt all motors immediately |
distance sensor | Measures distance to nearest object โ triggers actions when too close |
if distance <= 10 | When object is โค10 cm away โ typically stop or turn |
3 sides ยท turn 120ยฐ each
4 sides ยท turn 90ยฐ each
forward, turn 90ยฐ, forward again
What does this robot do?
| Step | Action | Facing after |
|---|---|---|
| i = 0 | Forward 30, turn 120ยฐ | 120ยฐ (SE) |
| i = 1 | Forward 30, turn 120ยฐ | 240ยฐ (SW) |
| i = 2 | Forward 30, turn 120ยฐ | Back to 0ยฐ |
Result: a triangle โ 3 ร 120ยฐ = 360ยฐ total rotation.
| Pattern | How |
|---|---|
| Straight line | forward() with no turns |
| Square | Repeat 4 times: forward + turn 90ยฐ |
| Triangle | Repeat 3 times: forward + turn 120ยฐ |
| L-shape | Forward, turn 90ยฐ, forward (different lengths) |
| Obstacle stop | if distance <= threshold โ stop() |
forward 20, turn right 90ยฐ. What shape and total distance?
if dist <= 10. Does the robot stop or move?
if branch is skipped and the else branch runs (move forward).
range(4) โ and exterior angle 360 รท 4 = 90ยฐ โ so turn_right(90).
A short audio explainer linking Boole's 1854 ideas to today's AI.
A short film tying the year's content together.
Slide deck reviewing the key concepts. Opens full screen with a back button.