input: Write a python function to count the number of ones in the binary representation of a given integer.
  assert count_ones(5) == 2  # Binary: 101
  assert count_ones(15) == 4  # Binary: 1111
  assert count_ones(0) == 0  # Binary: 0
  assert count_ones(1) == 1  # Binary: 1
  assert count_ones(1023) == 10  # Binary: 1111111111
output: def count_ones(n):
      return bin(n).count('1')