DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python count bits
counts = bytes(bin(x).count("1") for x in range(256)) # py2: use bytearray
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#python
#count
#bits
ADD COMMENT
Topic
COMMENT
Name
3+9 =
Submit