Operators
Operator priority
>>> 3 * 2 + 20 - 46
-20
>>> 3 * (2 + 20 - 46)
-72Assignment
>>> a = 1 # creates a new integer object of value 1
# and stores the address in variable a.
>>> a = 2 # creates a new integer object of value 2
# and stores the address in variable a.
>>> b = a # stores the address of variable a inside
# variable b, they point to the same object.Multiply
Exercise:
Add
Exercise:
Equality
Division
Power
Shortcut operators
Membership test
Boolean operators
not
False like values
True like
or
and
Comparision Operators
Last updated