Python operators: Difference between revisions
From wikinotes
Line 1: | Line 1: | ||
= | = Equality Greater/Less Than = | ||
< | <blockquote> | ||
<syntaxhighlight lang="python"> | |||
== / != # equal/not-equal | |||
is / is not # same /not-same instance | |||
>= / <= # greater/less than | |||
</ | </syntaxhighlight> | ||
</blockquote><!-- Equality Greater/Less than --> | |||
= bitwise operators = | = bitwise operators = |
Revision as of 00:53, 31 July 2021
Equality Greater/Less Than
== / != # equal/not-equal is / is not # same /not-same instance >= / <= # greater/less than
bitwise operators
x | y // bitwise or x ^ y // bitwise exclusive and x & y // bitwise and x << n // bitwise shift by n bits x >> n // bitwise shift by n bits ~x // invert bits