def binary_function(value):
    """
    It converts a decimal number into a binary number by using
    a recursion function.
    """
      
    try:
        binary_string = ''
        
        #Append binary_list 
        binary_list.append(value%2) 

        # recursion base cases 
        if value == 0 or value == 1 or value == -1:
            binary_list.reverse()
        
            for item in binary_list:
                #Append binary_string 
                binary_string += str(item)
                
            # Convert string to an int.
            return int(binary_string)
              
        else:
            if value > 0:
                return binary_function(value/2)
        
            else:
                return binary_function(-value/2)*-1
            
    #Raise TypeError if input is not numerical
    except TypeError:
        print 'Please enter an integer.'

    It converts a decimal number into a binary number by using
    a recursion function.
    
recipes/Python/577034_BinaryDecimal_Recursion/recipe-577034.py