(self, other: Union[int, float, Fraction, Monomial])
Multiply a given polynomial
        to a copy of self.
Multiply a given polynomial
        to a copy of self.
Multiply a given polynomial to a copy of self .
def __mul__(self, other: Union[int, float, Fraction, Monomial]):
        """
        Multiply a given polynomial
        to a copy of self.
        """
        if isinstance(other, int) or isinstance(other, float) or isinstance(other, Fraction):
            result = Polynomial([])
            monos = {m.clone() for m in self.all_monomials()}
            for m in monos:
                result = result.__add__(m.clone()*other)
            return result
        elif isinstance(other, Monomial):
            result = Polynomial([])
            monos = {m.clone() for m in self.all_monomials()}
            for m in monos:
                result = result.__add__(m.clone() * other)
            return result
        elif isinstance(other, Polynomial):
            temp_self = {m.clone() for m in self.all_monomials()}
            temp_other = {m.clone() for m in other.all_monomials()}

            result = Polynomial([])

            for i in temp_self:
                for j in temp_other:
                    result = result.__add__(i * j)

            return result
        else:
            raise ValueError('Can only multiple int, float, Fraction, Monomials, or Polynomials with Polynomials.')
def __mul__ ( self , other : Union [ int , float , Fraction , Monomial ] ) : if isinstance ( other , int ) or isinstance ( other , float ) or isinstance ( other , Fraction ) : result = Polynomial ( [ ] ) monos = { m . clone ( ) for m in self . all_monomials ( ) } for m in monos : result = result . __add__ ( m . clone ( ) * other ) return result elif isinstance ( other , Monomial ) : result = Polynomial ( [ ] ) monos = { m . clone ( ) for m in self . all_monomials ( ) } for m in monos : result = result . __add__ ( m . clone ( ) * other ) return result elif isinstance ( other , Polynomial ) : temp_self = { m . clone ( ) for m in self . all_monomials ( ) } temp_other = { m . clone ( ) for m in other . all_monomials ( ) } result = Polynomial ( [ ] ) for i in temp_self : for j in temp_other : result = result . __add__ ( i * j ) return result else : raise ValueError ( 'Can only multiple int, float, Fraction, Monomials, or Polynomials with Polynomials.' )