Operators Flashcards
1
Q
+
A
Addition
…2 + 4 == 6
2
Q
-
A
Subtraction
…2 - 4 == -4
3
Q
*
A
Multiplication
…2 * 4 == 8
4
Q
**
A
Power of
…2 ** 4 == 16
5
Q
/
A
Division
…2 / 4 == 0.5
6
Q
//
A
Floor division
…2 // 4 == 0
7
Q
%
A
String interpolate or modulus
…2 % 4 == 2
8
Q
<
A
Less than
…4 < 4 == False
9
Q
>
A
Greater than
…4 > 4 == False
10
Q
<=
A
Less than or equal
…4 <= 4 == True
11
Q
> =
A
Greater than or equal to
…4 >= 4 == True
12
Q
==
A
Equal
…4 == 5 == False
13
Q
!=
A
Not equal
…4 != 5 == True
14
Q
( )
A
Parentheses
…len(‘hi’) == 2
15
Q
[ ]
A
List brackets
…[1, 3, 4]