Maths Flashcards
1
Q
Arithmetic Operators
A
+ Add
- Subtract
* Multiply
/ Divide
** Exponent
2
Q
+= Operator
A
Convenient way of modifying a variable. It takes the existing value and adds to it.
Can also be used for other operators such as -= or *=
my_number = 4
my_number += 2
#result is 6
3
Q
The Modulo (%) Operator
A
Helps you know ONLY what the remainder is after a division
5 ÷ 2 = 2 with 1 remainder
5 % 2
#result is 1