PyDocs

Nav

Data Types

bin

enum

function · Added in 3.11 (source)
  • bin(num, max_bits=None)
Like built-in bin(), except negative values are represented in
twos-complement, and the leading bit always indicates sign
(0=positive, 1=negative).

>>> bin(10)
'0b0 1010'
>>> bin(~10)   # ~10 is -11
'0b1 0101'
1 Example
>>> import enum
>>> enum.bin(10)
'0b0 1010'
>>> enum.bin(~10)   # ~10 is -11
'0b1 0101'
from the Python docs
See Also
No see-alsos for enum/bin
0 Notes
No notes for bin