input: Write a function to convert a number into binary format. If the number is 0, return 0. Otherwise, loop through the number to get the remainders which represent the bits of the binary, and construct the binary representation as a string.
  assert convert_to_binary(10)=='1010'
  assert convert_to_binary(0)==0
  assert convert_to_binary(7)=='111'
  assert convert_to_binary(255)=='11111111'
  assert convert_to_binary(8)=='1000'
output: def convert_to_binary(n):
      if n == 0:
          return 0
      binary_str = ""
      while n > 0:
          binary_str = str(n % 2) + binary_str
          n = n // 2
      return binary_str