On this page
operator.and_
Prev: operator.add | Up: operator | Next: operator.attrgetter
Rel: operator.abs, operator.add, operator.attrgetter, operator.call
Ref: docs.python.org — operator.and_
Tags: #public #python3 #stdlib #operator
Import
import operator
from operator import and_
Signature & Overview
operator.and_(a, b, /)
Same as a & b.
Usage
import operator
assert operator.and_(0b1100, 0b1010) == 0b1000
Gotchas
- Bitwise
&(NOT logicaland): Trailing underscore avoids Python'sandkeyword.
REPL Inspect
from operator import and_
help(and_)
Linked from
- tuts/python3/stdlib_module/operator
- tuts/python3/stdlib_module/operator/abs
- tuts/python3/stdlib_module/operator/add
- tuts/python3/stdlib_module/operator/attrgetter
- tuts/python3/stdlib_module/operator/call
- tuts/python3/stdlib_module/operator/concat
- tuts/python3/stdlib_module/operator/contains
- tuts/python3/stdlib_module/operator/countOf
- tuts/python3/stdlib_module/operator/delitem
- tuts/python3/stdlib_module/operator/eq
- tuts/python3/stdlib_module/operator/floordiv
- tuts/python3/stdlib_module/operator/ge
- tuts/python3/stdlib_module/operator/getitem
- tuts/python3/stdlib_module/operator/gt
- tuts/python3/stdlib_module/operator/iadd
- tuts/python3/stdlib_module/operator/iand
- tuts/python3/stdlib_module/operator/iconcat
- tuts/python3/stdlib_module/operator/ifloordiv
- tuts/python3/stdlib_module/operator/ilshift
- tuts/python3/stdlib_module/operator/imatmul
- tuts/python3/stdlib_module/operator/imod
- tuts/python3/stdlib_module/operator/imul
- tuts/python3/stdlib_module/operator/index
- tuts/python3/stdlib_module/operator/indexOf
- tuts/python3/stdlib_module/operator/inv
- tuts/python3/stdlib_module/operator/invert
- tuts/python3/stdlib_module/operator/ior
- tuts/python3/stdlib_module/operator/ipow
- tuts/python3/stdlib_module/operator/irshift
- tuts/python3/stdlib_module/operator/is_
- tuts/python3/stdlib_module/operator/is_none
- tuts/python3/stdlib_module/operator/is_not
- tuts/python3/stdlib_module/operator/is_not_none
- tuts/python3/stdlib_module/operator/isub
- tuts/python3/stdlib_module/operator/itemgetter
- tuts/python3/stdlib_module/operator/itruediv
- tuts/python3/stdlib_module/operator/ixor
- tuts/python3/stdlib_module/operator/methodcaller
Related notes
- tuts/python3/stdlib_module/operator/abs Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/add Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/attrgetter Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/call Linked here; links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/operator/concat links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/contains links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/countOf links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/delitem links to this page; shared tags: #operator, #stdlib
- tuts/python3/stdlib_module/operator/eq links to this page; shared tags: #operator, #stdlib