1. Python

Operator Python Module

Operator Python Module just maps some functions to intrinsic built-in functions. For example – add(a, b) is mapped to a + b intrinsic built-in function by this Operator Module.
Below is a table containing all of Functions in Python’s Operator Module.

Additiona + badd(a, b)
Concatenationseq1 + seq2concat(seq1, seq2)
Containment Testobj in seqcontains(seq, obj)
True Divisiona / btruediv(a, b)
Floor Divisiona // bfloordiv(a, b)
Bitwise Anda & band_(a, b)
Bitwise Exclusive Ora ^ bxor(a, b)
Bitwise Inversion~ainvert(a)
Bitwise Ora | bor_(a, b)
Exponentiationa ** bpow(a, b)
Identitya is bis_(a, b)
Identitya is not bis_not(a, b)
Indexed Assignmentobj[k] = vsetitem(obj, k, v)
Indexed Deletiondel obj[k]delitem(obj, k)
Indexingobj[k]getitem(obj, k)
Left Shifta << blshift(a, b)
Moduloa % bmod(a, b)
Multiplicationa * bmul(a, b)
Matrix Multiplicationa @ bmatmul(a, b)
Arithmetic Negation– aneg(a)
Logical Negationnot anot_(a)
Positive+ apos(a)
Right Shifta >> brshift(a, b)
Slice Assignmentseq[i:j] = valuessetitem(seq, slice(i, j), values)
Slice Deletiondel seq[i:j]delitem(seq, slice(i, j))
Slicingseq[i:j]getitem(seq, slice(i, j))
String Formattings % objmod(s, obj)
Subtractiona – bsub(a, b)
Truth Testobjtruth(obj)
Orderinga < blt(a, b)
Orderinga <= ble(a, b)
Equalitya ==b eq(a, b)
Differencea != bne(a, b)
Orderinga >= bge(a, b)
Orderinga > bgt(a, b)
Comments to: Operator Python Module

Your email address will not be published.