input: from typing import List
  
  def convert_to_binary(num) -> str:
      """ Generate a code in Python to convert a number into binary format
      >>> convert_to_binary(10)
      '1010'
      >>> convert_to_binary(0)
      '0'
      >>> convert_to_binary(15)
      '1111'
      """
      
      # check if the number is 0, if so return 0 directly
      if num == 0:
          return '0'
      
      # initialize an empty string to store binary representation
      binary = ''
      
      # loop through the number and divide by 2 to get each binary digit (bit)
      while num != 0:
          remainder = num % 2
          binary = str(remainder) + binary
          num = num // 2
          
      return binary
output:     # check if the number is 0, if so return 0 directly
      if num == 0:
          return '0'
      
      # initialize an empty string to store binary representation
      binary = ''
      
      # loop through the number and divide by 2 to get each binary digit (bit)
      while num != 0:
          remainder = num % 2
          binary = str(remainder) + binary
          num = num // 2
          
      return binary