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

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