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

Understanding pseudocode

Our programming environment here on Khan Academy uses the JavaScript programming language. There are a large number of programming languages out there, and you may be learning a different language in your AP CSP class.
Thankfully, we have another way to describe programs: pseudocode. Pseudocode is a language that doesn't actually run anywhere, but still represents programming concepts that are common across programming languages. There are different flavors of pseudocode, so here we'll use the one that's used by the AP CSP exam.
This is pseudocode for displaying output:
DISPLAY (expression)
That line of pseudocode means "displays the value of expression followed by a space."
For example, you might see pseudocode like this:
DISPLAY ("Howdy")
DISPLAY ("Neighbor!")
That represents code that outputs: "Howdy Neighbor! "
The DISPLAY (expression) pseudocode is similar to the println(expression) that we just learned, but they're slightly different because DISPLAY() represents code that adds a space while println() adds a new line.
As we go through and learn programming concepts, we'll also show you the pseudocode for each of them, and we'll use the pseudocode in exercises instead of a particular language like JavaScript or Python.
Speaking of exercises: it's practice time!

🙋🏽🙋🏻‍♀️🙋🏿‍♂️Do you have any questions about this topic? We'd love to answer— just ask in the questions area below!

Want to join the conversation?