Everything you need for a 5, in one place
This is a complete walkthrough of the AP CSP exam: the 5 Big Ideas, every Python and AP Pseudocode construct you're responsible for, networking & the Internet, and a searchable library of 500+ worked code examples — organized the way the CodeHS AP CSP (Python) course sequences the curriculum.
Exam format
| Section | Format | Questions | Time | Exam weight |
|---|---|---|---|---|
| Section I | Multiple choice (some in sets, some standalone, includes short code-reading & "Explore" skills) | 70 | 2 hr | 70% |
| Section II | Create Performance Task (submitted before the exam date — a program + written responses) | 1 task | ~12 hrs over multiple class periods | 30% |
The 5 Big Ideas & how they're weighted
Click any card to jump to that Big Idea's full walkthrough.
Creative Development
Collaboration, program design, iterative development, debugging.
Data
Binary, data compression, extracting information from data, bits & bytes.
Algorithms & Programming
Variables, control structures, lists, procedures, algorithms, abstraction.
Computer Systems & Networks
The Internet, fault tolerance, parallel & distributed computing, cybersecurity.
Impact of Computing
Beneficial & harmful effects, the digital divide, bias, safe computing, IP.
How to use this site
- Work through Big Ideas 1–5 in order — each panel has plain-English definitions, bullet-point summaries, and inline Python/Pseudocode examples.
- Keep the Python ↔ Pseudocode reference open while you practice — the exam is written in College Board's own pseudocode, not Python, and the two disagree on some important details (looking at you, list indexing).
- Use the Code Example Library to search or filter by topic when you want to drill one construct (loops, lists, procedures, etc.) until it's automatic.
- The night before the exam, skim the Cheat Sheet — it's the whole course compressed to one scroll.
Scoring, at a glance
| AP Score | What it roughly takes |
|---|---|
| 5 | Strong performance on both the MC exam and a well-documented Create Task with clear procedural abstraction and a thorough algorithm explanation. |
| 4 | Solid MC performance; Create Task hits most rubric rows but may be thin on one (e.g., the algorithm explanation or data abstraction). |
| 3 | Passing MC performance; Create Task meets the basic requirements. |
Creative Development
CRD is about how programs get built, not what they compute: planning, collaborating, developing incrementally, and debugging systematically. It's the Big Idea most directly tested by your Create Performance Task.
Key vocabulary
- Incremental & iterative development
- Building a program in small pieces, testing each piece, then refining based on what you learn — rather than writing the whole thing at once.
- Program design
- Planning what a program should do before writing it: identifying inputs, outputs, and the steps needed, often with pseudocode, flowcharts, or comments.
- Collaboration
- Working with others (pair programming, code review, shared docs) to plan, write, and improve a program — a required part of the Create Task.
- Debugging
- Systematically finding and fixing errors: syntax errors (bad grammar), runtime errors (crashes while running), and logic errors (runs, but gives the wrong answer).
- Input
- Data a program receives from the user, a file, a sensor, or another program.
- Output
- Data a program produces: on-screen display, a file, a sound, or a signal to hardware.
The three error types you must be able to tell apart
| Error type | What happens | Example |
|---|---|---|
| Syntax error | Code violates the language's grammar rules; won't even run | if x = 5: in Python (should be ==) — or a missing colon |
| Runtime error | Code is grammatically valid but crashes while executing | Dividing by zero; indexing past the end of a list |
| Logic error | Code runs fine and produces output, but the output is wrong | Using < instead of <= in a boundary check |
Debugging strategies you'll be tested on
- Trace the code by hand — walk through it line by line, tracking each variable's value (this is exactly what MC "code tracing" questions ask you to simulate).
- Test with boundary/extreme cases — empty lists, 0, negative numbers, the first/last index.
- Isolate the problem — comment out or simplify code until the bug disappears, then add pieces back.
- Use print/DISPLAY statements to inspect a variable's value at a specific point in execution.
- Rubber-duck it — explain the code out loud, line by line; you often spot the bug mid-sentence.
Worked examples
if x = 5: print("five") # SyntaxError: invalid syntax — should be ==
if x == 5: print("five")
nums = [1, 2, 3] print(nums[5]) # IndexError: list index out of range
nums ← [1, 2, 3] DISPLAY(nums[5]) // runtime error: index doesn't exist
def is_adult(age): return age > 18 # bug: excludes 18
def is_adult(age): return age >= 18
The Create Performance Task — rubric in plain English
- Program purpose & function — a video demo plus a written response explaining what your program does and how to use it.
- Data / input — your program must use at least one list (or other collection) to manage complexity, and that list must meaningfully affect the program's behavior.
- Procedural abstraction — you must write a student-developed procedure that has a parameter (that meaningfully changes what happens) and is called at least twice — once to test a different value, and once from within a conditional or loop your program uses.
- Algorithm implementation — the program must include a segment implementing an algorithm with sequencing, selection (if/else), and iteration (loops), all working together, and you must explain how it works.
- Testing — you must show evidence you tested your program, including at least one input that reveals a bug or unexpected behavior you had to address.
Data
Computers only store bits — 0s and 1s. This Big Idea is about how binary represents everything else (numbers, text, images, sound), how we compress and transform data, and how we pull meaningful information out of it.
Key vocabulary
- Bit
- A single binary digit: 0 or 1. The smallest unit of data a computer stores.
- Byte
- A group of 8 bits. Can represent 2⁸ = 256 distinct values (0–255).
- Binary number system
- Base-2: every digit's place value is a power of 2 (…, 8, 4, 2, 1) instead of powers of 10.
- Overflow error
- Occurs when a calculated value is too large to be stored in the space allotted for it (e.g., adding 1 to the max value a fixed number of bits can hold).
- Lossless compression
- Compresses data so it can be perfectly reconstructed — no information is lost (e.g., ZIP, PNG).
- Lossy compression
- Compresses data by permanently discarding some information to save more space — the original can't be perfectly rebuilt (e.g., JPEG, MP3).
- Metadata
- "Data about data" — info describing a file without being its main content (e.g., a photo's timestamp, GPS location, camera model).
- Data abstraction
- Managing complexity by using a variable, list, or other structure to represent a collection of values as a single named object.
Binary conversion — the skill you must have cold
Each binary digit's place value doubles as you move left: 128, 64, 32, 16, 8, 4, 2, 1. To convert binary → decimal, add up the place values where there's a 1.
| Binary | Work | Decimal |
|---|---|---|
0000 1101 | 8 + 4 + 1 | 13 |
0001 1001 | 16 + 8 + 1 | 25 |
0110 0100 | 64 + 32 + 4 | 100 |
1111 1111 | 128+64+32+16+8+4+2+1 | 255 |
0110 0100.Why binary can represent anything
- Numbers — straightforward base-2 place value, as above.
- Text — each character maps to a binary number via an encoding scheme like ASCII (7-bit, English-centric, 128 characters) or Unicode (supports far more characters/languages/emoji, using more bits).
- Images — broken into a grid of pixels; each pixel's color is stored as binary numbers (e.g., RGB values 0–255 each).
- Sound — sampled at regular intervals (sampling rate); each sample's amplitude is stored as a binary number.
- This is digital data representation: any kind of information can be encoded as a sequence of bits if everyone agrees on the encoding scheme used to interpret it.
Compression trade-offs
| Lossless | Lossy | |
|---|---|---|
| Reconstruction | Exact original recovered | Approximation only — data is gone for good |
| Compression ratio | Smaller savings | Much smaller files possible |
| Good for | Text, code, spreadsheets — anything where every bit matters | Photos, video, audio — where a little quality loss is invisible/inaudible |
| Examples | ZIP, FLAC, PNG | JPEG, MP3, most streaming video |
Extracting information from data
Raw data alone often isn't useful — programs and people transform, filter, and combine it to find patterns, make predictions, and support conclusions. Key ideas:
- Large data sets can reveal patterns/trends that a small sample can't — but more data isn't automatically better if it's biased or poorly collected.
- Metadata (like geotags on photos or timestamps on posts) can be combined across many data points to infer things the data wasn't explicitly designed to reveal — this connects directly to privacy concerns in Big Idea 5.
- Data cleaning — fixing missing, duplicated, or inconsistent data before analyzing it, since bad input data produces unreliable conclusions ("garbage in, garbage out").
Worked examples
scores = [88, 92, 79, 95] total = 0 for s in scores: total = total + s average = total / len(scores) print(average)
scores ← [88, 92, 79, 95] total ← 0 FOR EACH s IN scores { total ← total + s } average ← total / LENGTH(scores) DISPLAY(average)
bits = "01101100" value = int(bits, 2) print(value) # 108
// 0110 1100 // 64 + 32 + 8 + 4 = 108 DISPLAY(108)
Algorithms & Programming
This is the biggest Big Idea on the exam (30–35% of Section I) and the one this site's example library leans into hardest. It's the actual "how to program" content — the CodeHS units on variables, control structures, lists, and procedures all live here.
Key vocabulary
- Algorithm
- A finite, well-defined sequence of steps for solving a problem or accomplishing a task.
- Variable
- A named location in memory that stores a value which can change while the program runs.
- Sequencing
- Statements execute one after another, in order, unless changed by selection or iteration.
- Selection
- Using a Boolean condition to decide which of two or more paths of statements to execute (if/else).
- Iteration
- Repeating a set of statements, either a set number of times or until a condition is met (loops).
- Procedure (function)
- A named group of programming instructions that may take parameters and may return a value; used to manage complexity by abstracting a task.
- Parameter
- A variable in a procedure's definition that receives a value (an argument) when the procedure is called.
- Return value
- The value a procedure sends back to the code that called it.
- List (array)
- An ordered collection of values, referenced by a single name, used to manage complexity when working with many related values.
- Procedural abstraction
- Hiding a procedure's internal implementation details behind its name — you can call it without knowing exactly how it works inside.
- Undefined behavior / unexpected result
- What happens when an algorithm is run on an input outside the range it was designed for.
1. Variables & assignment
A variable stores a value under a name. In pseudocode, assignment uses ←; in Python, =.
score = 0 name = "Ada" score = score + 10
score ← 0 name ← "Ada" score ← score + 10
← means "evaluate the right side first, then store it" — same as Python's =. The exam sometimes tests whether you know assignment isn't algebraic equality: x ← x + 1 is legal and means "increase x by one," not "solve for x."2. Operators
| Category | Python | AP Pseudocode |
|---|---|---|
| Arithmetic | + - * / // % ** | + - * / MOD |
| Relational | == != > < >= <= | = ≠ > < ≥ ≤ |
| Boolean | and or not | AND OR NOT |
remainder = 17 % 5 print(remainder) # 2
remainder ← 17 MOD 5 DISPLAY(remainder) // 2
3. Selection (conditionals)
if grade >= 90: letter = "A" elif grade >= 80: letter = "B" else: letter = "C or below"
IF (grade ≥ 90) { letter ← "A" } ELSE { IF (grade ≥ 80) { letter ← "B" } ELSE { letter ← "C or below" } }
elif — a chain of alternatives is written as nested IF/ELSE blocks. Reading these nested blocks correctly (which condition actually "wins") is one of the most common MC question types.4. Iteration (loops)
| Pseudocode | Meaning | Closest Python |
|---|---|---|
REPEAT n TIMES | Run the block exactly n times | for i in range(n): |
REPEAT UNTIL (condition) | Run until condition becomes true (checked before each pass) | while not condition: |
FOR EACH item IN list | Run once per element in a list | for item in list: |
for i in range(5): print("Hi")
REPEAT 5 TIMES { DISPLAY("Hi") }
x = 0 while not (x >= 10): x = x + 1
x ← 0 REPEAT UNTIL (x ≥ 10) { x ← x + 1 }
colors = ["red", "blue"] for c in colors: print(c)
colors ← ["red", "blue"] FOR EACH c IN colors { DISPLAY(c) }
5. Lists — and the #1 exam gotcha
lst[0] is the first element. AP Pseudocode lists are 1-indexed. list[1] is the first element. This single difference causes more careless exam mistakes than anything else in AAP — always check which language a question is using before you touch an index.| Operation | Python | AP Pseudocode |
|---|---|---|
| Create | nums = [3, 5, 7] | nums ← [3, 5, 7] |
| Access first item | nums[0] | nums[1] |
| Length | len(nums) | LENGTH(nums) |
| Add to end | nums.append(9) | APPEND(nums, 9) |
| Insert at index | nums.insert(1, 4) | INSERT(nums, 1, 4) |
| Remove at index | nums.pop(0) / del nums[0] | REMOVE(nums, 1) |
nums = [] for i in range(1, 6): nums.append(i * i) print(nums) # [1,4,9,16,25]
nums ← [] i ← 1 REPEAT UNTIL (i > 5) { APPEND(nums, i * i) i ← i + 1 } DISPLAY(nums)
6. Procedures / functions
def is_even(n): return n % 2 == 0 print(is_even(4)) # True print(is_even(7)) # False
PROCEDURE is_even(n)
{
RETURN (n MOD 2 = 0)
}
DISPLAY(is_even(4))
DISPLAY(is_even(7))is_even is written and tested, any other code can call is_even(x) without caring how it's implemented inside — that's abstraction: managing complexity by hiding detail behind a name.7. Robot / Karel-style commands
Some MC questions and simulations use a simplified "robot" acting on a grid.
| Command | Effect |
|---|---|
MOVE_FORWARD() | Robot moves one square in the direction it's facing |
ROTATE_LEFT() | Robot turns 90° left, in place |
ROTATE_RIGHT() | Robot turns 90° right, in place |
CAN_MOVE(direction) | Returns true/false — is the square in that direction open? |
REPEAT UNTIL (NOT CAN_MOVE(forward))
{
MOVE_FORWARD()
}
ROTATE_RIGHT()// Drive forward until you hit a wall,
// then turn right.8. Classic algorithms
Linear search
def linear_search(lst, target): for i in range(len(lst)): if lst[i] == target: return i return -1
PROCEDURE linear_search(lst, target)
{
i ← 1
REPEAT UNTIL (i > LENGTH(lst))
{
IF (lst[i] = target)
{
RETURN (i)
}
i ← i + 1
}
RETURN (-1)
}Binary search (list must be sorted first)
def binary_search(lst, target): lo, hi = 0, len(lst) - 1 while lo <= hi: mid = (lo + hi) // 2 if lst[mid] == target: return mid elif lst[mid] < target: lo = mid + 1 else: hi = mid - 1 return -1
// Each check eliminates HALF the
// remaining list. For n items, that's
// about log2(n) checks — for 1,000,000
// items, ~20 checks instead of up to
// 1,000,000 for linear search.Selection sort
def selection_sort(lst): for i in range(len(lst)): min_i = i for j in range(i+1, len(lst)): if lst[j] < lst[min_i]: min_i = j lst[i], lst[min_i] = lst[min_i], lst[i]
// Repeatedly find the smallest
// remaining value and swap it into
// its correct position, left to right.9. Simulations & abstraction
- A simulation uses a program to imitate a real-world (or imagined) process — useful because it's often cheaper, safer, or faster than the real thing, but it's only as accurate as the assumptions built into it.
- Abstraction in programming means managing complexity by hiding detail: procedural abstraction hides implementation behind a name; data abstraction hides low-level representation behind a variable or list name.
- Every abstraction involves a trade-off — you gain simplicity but may lose some control, accuracy, or efficiency.
Computer Systems & Networks
This Big Idea is almost entirely conceptual — no code. It's about how computers link together into networks and the Internet, why that design is resilient, and how to reason about security. Full networking walkthrough below.
Key vocabulary
- Computing device
- Anything that can run a program: computers, phones, routers, embedded sensors, etc.
- Computer network
- A group of interconnected computing devices capable of sending and/or receiving data.
- The Internet
- A network of networks, connected by protocols that let devices from different networks and manufacturers communicate.
- Protocol
- An agreed-upon set of rules that specifies how data is formatted, transmitted, and interpreted between devices.
- Bandwidth
- The maximum amount of data that can be sent over a connection in a fixed amount of time, usually measured in bits per second.
- Latency / bandwidth impact
- Higher resolution video/audio and larger files require more bandwidth; too little bandwidth causes lag, buffering, or dropped data.
- Fault tolerance
- A system's ability to keep working, without total failure, when one of its parts fails.
- Redundancy
- Having multiple paths or backup components so that if one fails, another can take over — a key technique for fault tolerance.
- Parallel computing
- Using multiple processors simultaneously, within one machine, to divide up a task and solve it faster.
- Distributed computing
- Using multiple independent computers, connected over a network, to divide up a task and solve it collectively.
How the Internet actually works
1. Packets & packet switching
Data sent over the Internet is broken into small chunks called packets. Each packet is labeled with metadata (source address, destination address, sequence number) and can travel a different route across the network to reach the same destination.
- Why break data into packets? It lets many devices share the same network links fairly, lets packets reroute around failures/congestion, and lets the receiving end reassemble a large file even if pieces arrive out of order.
- At the destination, packets are reordered using their sequence numbers and reassembled into the original data.
- If a packet is lost, only that piece — not the whole transmission — needs to be resent.
2. IP addresses & DNS
- Every device on the Internet has an IP address — a unique numeric identifier used for routing.
- DNS (Domain Name System) translates human-friendly domain names (like
codehs.com) into IP addresses, because typing numbers isn't practical for people.
3. Protocols you're responsible for
| Protocol | What it does |
|---|---|
| TCP (Transmission Control Protocol) | Breaks data into packets, ensures they all arrive and get reassembled correctly, resending any that are lost. |
| IP (Internet Protocol) | Handles addressing and routing — getting each packet from its source to its destination. |
| HTTP / HTTPS | Rules for requesting and transmitting web pages; HTTPS adds encryption. |
4. Fault tolerance — why the Internet rarely "goes down"
- The Internet has no central point of control — it's a distributed, redundant mesh of routers and links.
- If one router or connection fails, packets are automatically rerouted through a different path — this is fault tolerance through redundancy.
- This same idea (redundancy → fault tolerance) applies beyond networking: RAID storage, backup power systems, and distributed servers all trade extra cost/complexity for resilience.
5. Bandwidth in practice
| Scenario | Bandwidth need |
|---|---|
| Sending a text message | Very low |
| Streaming 480p video | Moderate |
| Streaming 4K video | High |
| Video call with multiple participants | High, and needed in both directions (upload + download) |
6. Parallel vs. distributed computing
| Parallel computing | Distributed computing | |
|---|---|---|
| Where | Multiple processors/cores in one machine | Multiple separate machines over a network |
| Typical use | Speeding up one program on one computer | Splitting a huge task (e.g., search indexing, folding proteins) across many computers |
| Benefit | Faster completion time via simultaneous execution | Scales to problems too big for any single machine; adds fault tolerance |
| Cost | Coordination/communication overhead between processors | Network communication overhead; harder to coordinate |
Cybersecurity
- Cyberattack
- A deliberate attempt to damage, disrupt, or gain unauthorized access to a computing system or network.
- Malware
- Software designed to harm a system, steal data, or gain unauthorized access (viruses, worms, ransomware, spyware).
- Phishing
- Tricking a person (via fake emails, sites, or messages) into revealing sensitive information like passwords.
- Keylogging
- Malware that records every keystroke a user types, capturing passwords and other private data.
- Rogue access point
- An unauthorized wireless access point set up to intercept traffic from unsuspecting users who connect to it.
- DDoS attack
- Overwhelming a server with traffic from many sources at once so it can't respond to legitimate requests.
- Encryption
- Encoding data so that only someone with the correct key can decode/read it, protecting it in transit or storage.
- Symmetric encryption
- Same key used to both encrypt and decrypt — the key must be shared secretly between parties beforehand.
- Public key (asymmetric) encryption
- A public key (shared openly) encrypts data; only the matching private key (kept secret) can decrypt it — solves the "how do we share a key safely" problem.
- Multi-factor authentication
- Requiring 2+ independent proofs of identity (e.g., password + phone code) so a stolen password alone isn't enough to break in.
- Certificate Authority
- A trusted organization that verifies a website's identity and issues it a digital certificate, which is what makes the padlock/HTTPS trustworthy.
Impact of Computing
IOC is the second-largest Big Idea (21–26%) and is entirely about the social, ethical, legal, and equity dimensions of computing — no code, but precise vocabulary matters a lot here.
Key vocabulary
- Computing innovation
- Any product or process created using computing that includes a program as an integral part of its functionality.
- Beneficial effect
- A positive impact of a computing innovation on individuals, society, the economy, or culture.
- Harmful effect
- A negative impact — note that the same innovation can have both beneficial and harmful effects depending on context and who's affected.
- Digital divide
- The gap between people who have reliable access to computing technology/the Internet and those who don't — driven by cost, infrastructure, geography, and policy.
- Bias in computing
- When an algorithm or data set systematically favors or disadvantages certain groups — often unintentionally, from unrepresentative training data or the assumptions of whoever built the system.
- Crowdsourcing
- Obtaining input, data, or work by soliciting contributions from a large group of people, typically online.
- Citizen science
- Crowdsourcing applied to scientific research — everyday people contribute data or processing power to real research projects.
- PII (Personally Identifiable Information)
- Information that can be used on its own or combined with other data to identify a specific individual (name, SSN, address, biometric data).
- Digital footprint / metadata trail
- The trace of data a person leaves through online activity, which can be aggregated to build a surprisingly detailed profile of them.
- Intellectual property (IP)
- Legal rights over creations of the mind — protected via copyright, patents, and licensing.
- Open source
- Software whose source code is made publicly available for anyone to view, use, modify, and redistribute (often under specific license terms).
- Creative Commons license
- A licensing framework that lets creators grant certain usage rights to the public while keeping some rights reserved.
- Safe computing practices
- Habits/tools that reduce risk to a person's devices, data, or identity — e.g., strong unique passwords, MFA, keeping software updated, avoiding unknown links/attachments.
Ideas the exam tests again and again
- Every computing innovation has trade-offs. Almost no MC question about a new technology has a purely "good" or purely "bad" correct answer — the strongest answer usually names both a benefit and a cost/risk.
- Bias often comes from data, not evil intent. A facial recognition system trained mostly on one demographic will perform worse on others — this is a data/training issue, and questions often ask you to identify the bias's source.
- The digital divide compounds other inequalities. Lack of Internet access affects education, job access, and civic participation — treat it as a systemic issue, not just "some people don't have WiFi."
- Crowdsourcing has both power and risk. It can gather huge data sets fast (Wikipedia, citizen science, real-time traffic data) but is also vulnerable to bad-faith or low-quality contributions.
- Legal ≠ ethical, and both matter. Sharing something that's technically legal can still raise privacy or fairness concerns the exam wants you to identify.
- Anonymization isn't foolproof. Even "anonymized" data can sometimes be re-identified by cross-referencing it with other data sets — a classic IOC scenario question.
Quick-reference: benefit vs. harm framing
| Innovation | Typical beneficial effect | Typical harmful effect |
|---|---|---|
| Social media | Connects people globally; enables organizing/awareness | Misinformation spread; privacy loss; algorithmic bias in what's shown |
| Ride-sharing / GPS apps | Convenient, efficient routing, new income opportunities | Constant location tracking; job precarity for drivers |
| Facial recognition | Faster security screening, device unlocking | Documented lower accuracy for some demographics; surveillance concerns |
| Online learning platforms | Access to education regardless of location | Requires reliable Internet/hardware — worsens digital divide for those without it |
| Targeted advertising | More relevant ads/content for users | Built on extensive personal data collection, often without full user understanding |
Python ↔ AP Pseudocode, side by side
The exam is written entirely in College Board's official pseudocode (from the AP CSP Exam Reference Sheet), not Python. CodeHS teaches you to code in Python, then translate. This table is the whole reference sheet, mapped directly to the Python you already know.
Full syntax map
| Concept | Python | AP Pseudocode |
|---|---|---|
| Assignment | x = 5 | x ← 5 |
| Display output | print(x) | DISPLAY(x) |
| Get input | x = input() | INPUT(x) |
| Add / subtract / multiply / divide | + - * / | + - * / |
| Remainder | % | MOD |
| Equal to | == | = |
| Not equal to | != | ≠ |
| Greater / less than (or equal) | > < >= <= | > < ≥ ≤ |
| Logical AND / OR / NOT | and / or / not | AND / OR / NOT |
| If / else if / else | if / elif / else: | IF / ELSE { IF ... } / ELSE (nested) |
| Fixed-count loop | for i in range(n): | REPEAT n TIMES { } |
| Condition-controlled loop | while not cond: | REPEAT UNTIL (cond) { } |
| Loop over a list | for item in list: | FOR EACH item IN list { } |
| Create a list | lst = [1, 2, 3] | lst ← [1, 2, 3] |
| Index of first item | lst[0] | lst[1] |
| List length | len(lst) | LENGTH(lst) |
| Add to end of list | lst.append(x) | APPEND(lst, x) |
| Insert at index | lst.insert(i, x) | INSERT(lst, i, x) |
| Remove at index | lst.pop(i) | REMOVE(lst, i) |
| Define a function | def name(params): | PROCEDURE name(params) { } |
| Return a value | return value | RETURN(value) |
| Random integer a–b inclusive | random.randint(a, b) | RANDOM(a, b) |
| Robot: move forward | n/a (course-specific) | MOVE_FORWARD() |
| Robot: rotate | n/a (course-specific) | ROTATE_LEFT() / ROTATE_RIGHT() |
| Robot: check if path is open | n/a (course-specific) | CAN_MOVE(direction) |
| Boolean literals | True / False | true / false |
| Comment | # comment | // comment |
The 5 differences that trip people up
- Indexing: Python starts at 0. Pseudocode starts at 1. Always re-check which one a question is using.
- No
elif: Pseudocode expresses "else if" chains as anIFnested inside anELSEblock — extra braces, same logic. - Blocks use
{ }, not indentation: Pseudocode's grouping is explicit brackets. Python relies purely on indentation — no braces at all. REPEAT UNTILvs.while:REPEAT UNTIL (cond)keeps looping until cond is true — logically the opposite phrasing of Python'swhile cond:, which loops while it's true.- Procedures always show
RETURN(...)with parentheses in pseudocode, even though it behaves just like Python'sreturn value.
500+ worked examples
Every construct from the CodeHS AP CSP (Python) course, paired with its AP Pseudocode equivalent. Search by keyword or filter by topic — this is meant for drilling one concept until it's automatic, not reading top to bottom.
Cheat sheet
Skim this the morning of the exam. If a line doesn't make sense, jump back to its Big Idea.
Big Idea 1 — Creative Development
- 3 error types: syntax (won't run) · runtime (crashes) · logic (runs, wrong answer).
- Debug by tracing values by hand, testing boundary cases, isolating the failing section.
- Create Task needs: a list that affects behavior, a student-written procedure with a meaningful parameter called ≥2 ways, an algorithm using sequencing + selection + iteration together, and evidence of testing.
Big Idea 2 — Data
- Bit = 0/1. Byte = 8 bits = 256 possible values.
- Binary place values (left→right): 128, 64, 32, 16, 8, 4, 2, 1.
- Lossless = perfectly reversible, smaller savings (ZIP, PNG). Lossy = permanent quality loss, huge savings (JPEG, MP3).
- Metadata = data about data (timestamps, geotags) — can reveal more than intended when aggregated.
Big Idea 3 — Algorithms & Programming
- Python is 0-indexed. AP Pseudocode is 1-indexed. Check every time.
- Pseudocode has no
elif— it's nestedIFinsideELSE. REPEAT n TIMES= fixed count ·REPEAT UNTIL (cond)= loops until cond true ·FOR EACH x IN list= one pass per element.- List ops:
LENGTH,APPEND,INSERT,REMOVE. - Procedures:
PROCEDURE name(params) { RETURN(value) }— enables procedural abstraction. - Binary search needs a sorted list; it's ~log₂(n) checks vs. linear search's up to n checks.
Big Idea 4 — Computer Systems & Networks
- Data travels as packets (independently routed, reassembled by sequence number).
- Protocols = agreed-upon rules (TCP = reliable delivery, IP = addressing/routing, HTTP/S = web transfer).
- Fault tolerance comes from redundancy — no single point of failure.
- Parallel computing = multiple processors, one machine. Distributed computing = multiple machines, one network. Neither gives perfectly proportional speedup (coordination overhead).
- Security is trade-offs, not guarantees: encryption, MFA, and certificates reduce risk — none eliminate it.
Big Idea 5 — Impact of Computing
- Nearly every innovation has both a beneficial and a harmful effect — name both when asked.
- Bias usually comes from unrepresentative data/design choices, not explicit intent.
- Digital divide = unequal access to computing/Internet, which compounds other inequalities.
- PII = info that can identify a specific person; anonymized data can sometimes still be re-identified.
- Legal ≠ ethical — both are testable angles on the same scenario.