Introduction
In this chapter, we’ll learn about variables and assignment, and the difference between statements (code which has no evaluation) and expressions (which have evaluations). We’ll also learn about two additional arithmetic operators: floor division using the //
operator (also called Euclidean division or integer division), and the modulo operator %
(also called the remainder operator). Please note that the modulo operator has nothing to do with calculating percentages—this is a common confusion for beginners.
Learning objectives
- You will learn how to use the assignment operator and how to create and name variables.
- You will learn how to use the addition, subtraction, multiplication, division, and exponentiation operators.
- You will learn the difference between and use cases of division and Euclidian division (integer division).
- You will learn about modular arithmetic and how to use the remainder or “modulo” operator and floor division operator.
- You will learn operator precedence in Python.
Terms introduced
- absolute value
- assignment
- congruence
- dividend
- divisor
- Euclidean division
- evaluation
- exception
- expression
- floor function
- identifier
- modulus
- name
- operator
- quotient
- remainder
- statement
- variable
Copyright © 2023–2025 Clayton Cafiero
No generative AI was used in producing this material. This was written the old-fashioned way.