Pseudo Code vs. a Python Algorithm

Pseudo Code is essentially describing/writing code in a more “human-written” format rather than formally/actually “coded” format.

Below are examples highlighting the key difference(s) between a coded (Python) algorithm against a College Board Pseudo Code example.

College Board Pseudo Code example

Below is an algorithm to find the largest number in a list of positive numbers.

  1. Set largest number to 0
  2. Get next number in the list
  3. If number is larger than largestNumber then set largestNumber to number
  4. If there are more numbers in list, go back to step 2
  5. Display largest number
largestNumber = 0

numberList = [5, 8, 3, 12, 7, 10]

for number in numberList:
    if number > largestNumber:
        largestNumber = number

print("Largest number:", largestNumber)
Largest number: 12

College_Board_Algorithms_Diagram.png