input: def convert_to_binary(num):
      """
      Generate a code in Python to convert a number into binary format
      >>> convert_to_binary(10)
      '1010'
      >>> convert_to_binary(0)
      0
      """
output:     if num == 0:
          return '0'
      binary_str = ''
      while num > 0:
          binary_str = str(num % 2) + binary_str
          num = num // 2
      return binary_str