def count_set_bits(n):
 return ((1 + count_set_bits((n & (n - 1)))) if n else 0)

def count_set_bits ( n ) : return ( ( 1 + count_set_bits ( ( n & ( n - 1 ) ) ) ) if n else 0 )
number of 1 bits in binary expansion of a nonnnegative integer .