Am 25.10.2012 16:47, schrieb Charles Hixson: > In Python3 is there any good way to count the number of on bits in an > integer (after an & operation)?
Simple, easy, faster than a Python loop but not very elegant: bin(number).count("1") Christian -- http://mail.python.org/mailman/listinfo/python-list