(self, other: Union[int, float, Fraction, Monomial])
return
For Polynomials, only division by a monomial
        is defined.

        TODO: Implement polynomial / polynomial.
For Polynomials, only division by a monomial
        is defined.
For Polynomials only division by a monomial is defined .
def __truediv__(self, other: Union[int, float, Fraction, Monomial]):
        """
        For Polynomials, only division by a monomial
        is defined.

        TODO: Implement polynomial / polynomial.
        """
        if isinstance(other, int) or isinstance(other, float) or isinstance(other, Fraction):
            return self.__truediv__( Monomial({}, other) )
        elif isinstance(other, Monomial):
            poly_temp = reduce(lambda acc, val: acc + val, map(lambda x: x / other, [z for z in self.all_monomials()]), Polynomial([Monomial({}, 0)]))
            return poly_temp
        elif isinstance(other, Polynomial):
            if Monomial({}, 0) in other.all_monomials():
                if len(other.all_monomials()) == 2:
                    temp_set = {x for x in other.all_monomials() if x != Monomial({}, 0)}
                    only = temp_set.pop()
                    return self.__truediv__(only)
            elif len(other.all_monomials()) == 1:
                temp_set = {x for x in other.all_monomials()}
                only = temp_set.pop()
                return self.__truediv__(only)

        raise ValueError('Can only divide a polynomial by an int, float, Fraction, or a Monomial.')

        return
def __truediv__ ( self , other : Union [ int , float , Fraction , Monomial ] ) : if isinstance ( other , int ) or isinstance ( other , float ) or isinstance ( other , Fraction ) : return self . __truediv__ ( Monomial ( { } , other ) ) elif isinstance ( other , Monomial ) : poly_temp = reduce ( lambda acc , val : acc + val , map ( lambda x : x / other , [ z for z in self . all_monomials ( ) ] ) , Polynomial ( [ Monomial ( { } , 0 ) ] ) ) return poly_temp elif isinstance ( other , Polynomial ) : if Monomial ( { } , 0 ) in other . all_monomials ( ) : if len ( other . all_monomials ( ) ) == 2 : temp_set = { x for x in other . all_monomials ( ) if x != Monomial ( { } , 0 ) } only = temp_set . pop ( ) return self . __truediv__ ( only ) elif len ( other . all_monomials ( ) ) == 1 : temp_set = { x for x in other . all_monomials ( ) } only = temp_set . pop ( ) return self . __truediv__ ( only ) raise ValueError ( 'Can only divide a polynomial by an int, float, Fraction, or a Monomial.' ) return