Maths Flashcards

1
Q

Arithmetic Operators

A

+ Add
- Subtract
* Multiply
/ Divide
** Exponent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly