Numbers and Booleans - mrprov12/DSPrep GitHub Wiki
= += -= *= /= **=
-
-
- / // **
// floor division
% remainder (mod)
== finds relation between two booleans, relational operator
!= result type: boool; "not equal to"
< <= > >=
and, or ->> bool op used to preform logical conjuction
- / // **
-
returns True when op is false orr 0, vice versa
removes item/element at a specified index location from lis, not returned; takes index as arg, deletes itema at index
num w/o decimal, +/-
num with decimal, +/- (always returned by /)
bool(1)
0, None, len() ie. [] or " ", bool(0)
if either is a float, will return a float
trial division: see if divides in evenly, common step to find primes and all divisors of
parity: mod 2, whether an integer is even or odd
if either is a float, will return a float
PEMDAS, M includes %
if same precedence, left to right
and, or, !
btwise: & = and, |. = or, ~ = not
exclusive or (^) = only when 1 op is true (vs or where bith can be true
not evaluated 1st, then and, or last
bitwise 1st, then logical op
excl or befor or
< > <= >= == !=