input: Write a function to convert a number into its binary representation. If the input number is 0, the function should return 0. Otherwise, it should return the binary string representation of the number.
  def convert_to_binary(num):
      # check if the number is 0, if so return 0
      if num == 0:
          return 0
      
      # initialize an empty binary string
      binary = ''
      
      # loop through the number and get the remainder 
      # which is the bits of the binary
      while num != 0:
          remainder = num % 2
          binary = str(remainder) + binary
          num = num // 2
      
      return binary
  
  # test the function 
  assert convert_to_binary(0) == 0
  assert convert_to_binary(10) == '1010'
  assert convert_to_binary(7) == '111'
  assert convert_to_binary(16) == '10000'
  assert convert_to_binary(32) == '100000'
output: def convert_to_binary(num):
      if num == 0:
          return 0
      binary = ''
      while num != 0:
          remainder = num % 2
          binary = str(remainder) + binary
          num = num // 2
      return binary