Julieta Shem <[email protected]> writes: How would you write this procedure? def powers_of_2_in(n): ...
def powers_of_2_in(n):
return (n ^ (n - 1)).bit_count() - 1
--
https://mail.python.org/mailman/listinfo/python-list
Julieta Shem <[email protected]> writes: How would you write this procedure? def powers_of_2_in(n): ...
def powers_of_2_in(n):
return (n ^ (n - 1)).bit_count() - 1
--
https://mail.python.org/mailman/listinfo/python-list