Chapter 3 - Summary¶
Chapter 3 included the following concepts from computing.
- Arithmetic Expression - An arithmetic expression contains a mathematical operator like
-
for subtraction or*
for multiplication. - Assignment - Assignment means setting a variable’s value. For example,
x = 5
assigns the value of 5 to a variable calledx
. - Assignment Dyslexia - Assignment Dyslexia is putting the variable name on the right and the value on the left as in
5 = x
. This is not a legal statement. - Integer Division - Integer division is when you divide one integer by another. In some languages this will only give you an integer result, but in Python 3 it returns a decimal value, unless you use the floor division operator,
//
. - Modulo - The modulo, or remainder operator,
%
, returns the remainder after you divide one value by another. For example the remainder of3 % 2
is 1 since 2 goes into 3 one time with a remainder of 1. - Tracing - Tracing a program means keeping track of the variables in the program and how their values change as the statements are executed. We used a Code Lens tool to do this in this chapter.
- Variable - A variable is a name associated with computer memory that can hold a value and that value can change or vary. One example of a variable is the score in a game.