Python Operators Flashcards
1
Q
*
A
multiplication
2
Q
/
A
division, float
3
Q
//
A
division, integer
4
Q
**
A
exponential (0.5 for sqrt)
5
Q
%
A
modulus, returns remainder after division. x % 10 is the last digit of x and x % 100 is the left two digits, etc.
6
Q
[ ]
A
indexing operator (create lists)
7
Q
[ : ]
A
slice operator
8
Q
in
A
string operator. substring is found in string
9
Q
is
A
returns True if the values of the variables reference the same object (a = ‘banana’, b = ‘banana’, a is b == True)