Summary

In this lab, we covered several major important topics. Let’s quickly review them.

Data Types in Pseudocode

  • string data type stores text. Use STRING(expression) to convert an expression to a string if possible.
  • number data type stores numbers. Use NUMBER(expression) to convert an expression to a number if possible.

Math Operators in Pseudocode

  • + Addition
  • - Subtraction
  • * Multiplication
  • / Division
  • MOD Modulo (the remainder of division)

Pseudocode Order of Operations

  1. Parentheses
  2. Multiplication, Division and Modulo from left to right
  3. Addition and Subtraction from left to right

Data Types in Python

  • str data type stores text (strings). Use str(expression) to convert an expression to a string if possible.
  • int data type stores whole numbers (integers). Use int(expression) to convert an expression to an integer if possible.
  • float data type stored decimal numbers (floating-point). Use float(expression) to convert an expression to a floating-point value, if possible.

Math Operators in Python

  • + Addition
  • - Subtraction
  • * Multiplication
  • ** Exponentiation (Power)
  • / Division
  • // Integer Division
  • % Modulo (the remainder of division)

Python Order of operations

  1. Parentheses
  2. Exponentiation
  3. Multiplication, Division, Integer Division, and Modulo from left to right
  4. Addition and Subtraction from left to right