If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

AP CSP pseudocode vs. Python

Since AP CS Principles is taught with a variety of programming languages, the AP CSP exam questions use a pseudocode that represents fundamental programming concepts.
You can see the full pseudocode reference online here or on page 205 of the College Board AP CSP exam description.

AP CSP Pseudocode vs. Python

There are also some differences between the AP CSP pseudocode and the Python language syntax.
This table highlights the biggest differences:
ConceptPseudocodePython
Assignmenta ← expressiona = expression
Equalitya = ba == b
Inequalitya ≠ ba != b
RepetitionREPEAT n TIMESfor i in range(n):
RepetitionREPEAT UNTIL (condition)while condition:
List indexlist[1] is first itemlist[0] is first item
To make sure you understand the pseudocode, practice using it in the exercises from our Programming and Algorithms units.

Want to join the conversation?