(self, other: Union[int, float, Fraction])
return self.__add__(other.__mul__(Fraction(-1, 1)))
Compute the subtraction
        of a monomial and a datatype
        such as int, float, Fraction, or Monomial.
Compute the subtraction
        of a monomial and a datatype
        such as int, float, Fraction, or Monomial.
Compute the subtraction of a monomial and a datatype such as int float Fraction or Monomial .
def __sub__(self, other: Union[int, float, Fraction]):
        """
        Compute the subtraction
        of a monomial and a datatype
        such as int, float, Fraction, or Monomial.
        """
        if isinstance(other, int) or isinstance(other, float) or isinstance(other, Fraction):
            mono = {i: self.variables[i] for i in self.variables if self.variables[i] != 0}
            if len(mono) != 0:
                raise ValueError('Can only subtract like monomials.')
            other_term = Monomial(mono, Monomial._rationalize_if_possible(other))
            return self.__sub__(other_term)
        if not isinstance(other, Monomial):
            raise ValueError('Can only subtract monomials')
        return self.__add__(other.__mul__(Fraction(-1, 1)))
def __sub__ ( self , other : Union [ int , float , Fraction ] ) : if isinstance ( other , int ) or isinstance ( other , float ) or isinstance ( other , Fraction ) : mono = { i : self . variables [ i ] for i in self . variables if self . variables [ i ] != 0 } if len ( mono ) != 0 : raise ValueError ( 'Can only subtract like monomials.' ) other_term = Monomial ( mono , Monomial . _rationalize_if_possible ( other ) ) return self . __sub__ ( other_term ) if not isinstance ( other , Monomial ) : raise ValueError ( 'Can only subtract monomials' ) return self . __add__ ( other . __mul__ ( Fraction ( - 1 , 1 ) ) )