Special Operators


Modulo is an operator that returns the remainder of any integer division.  It is the percent (%) sign.

Try this!

print(14%4)

print(6%2)

Why do these print statements result in different values?


Try using a numeric and a string in an expression.  For example:

print("hello"*3)


The Order of Math Operations Apply:

Exponentiation is done first, then * or /, then + or -.  If an operation is inside the parenthesis, then whatever is inside the parenthesis takes precedence.  All operators of equal precedence are executed from left to right.  The one exception to this is exponentiation.  If the exponent is an expression that must be calculated first to get an integer exponent, then that will be done first.


Try this! Use the following expressions:

a) print(3*5)

b) print(3**5)

c) print(3.*5)

d) print(3**5.)

e) print(3/5)

f) print(3//5)

g) print(-3/5)

h) print(-3//5)

i) print(3%5)

j) print(-3%5)