以下的問題在 google 的面試出現過:
輸入一個正整數,找出該數字二進位有幾個 1
def one_bits(num): # Fill this in. print(one_bits(23)) # 4 # 23 = 0b1011