Difference between revisions of "Python:Operators"

From wiki
Jump to navigation Jump to search
(Created page with "Most operators work as usual. ;a / b :Divide to floating point (in python2 the result datatype is determined by the arguments datatype i.e. both arguments int => result is in...")
(No difference)

Revision as of 11:12, 6 January 2018

Most operators work as usual.

a / b
Divide to floating point (in python2 the result datatype is determined by the arguments datatype i.e. both arguments int => result is int)
a // b
Divide to integer (truncated, not rounded)
a % b
Modulo
a ** b
Power
a << b
bit-shift left
a >> b
bit-shift right
a & b
And
a | b
Or
a ^ b
Xor