(self, monomials: Iterable[Union[int, float, Fraction, Monomial]])
Create a polynomial in the given variables:
        Examples:

            Polynomial([
                Monomial({1:1}, 2),
                Monomial({2:3, 1:-1}, -1),
                math.pi,
                Fraction(-1, 2)
            ]) = (a_1)^2 + (-1)(a_2)^3(a_1)^(-1) + 2.6415926536

            Polynomial([]) = 0
Create a polynomial in the given variables:
        Examples:
Create a polynomial in the given variables : Examples :
def __init__(self, monomials: Iterable[Union[int, float, Fraction, Monomial]]) -> None:
        '''
        Create a polynomial in the given variables:
        Examples:

            Polynomial([
                Monomial({1:1}, 2),
                Monomial({2:3, 1:-1}, -1),
                math.pi,
                Fraction(-1, 2)
            ]) = (a_1)^2 + (-1)(a_2)^3(a_1)^(-1) + 2.6415926536

            Polynomial([]) = 0

        '''
        self.monomials = set()
        for m in monomials:
            if any(map(lambda x: isinstance(m, x), [int, float, Fraction])):
                self.monomials |= {Monomial({}, m)}
            elif isinstance(m, Monomial):
                self.monomials |= {m}
            else:
                raise ValueError('Iterable should have monomials, int, float, or Fraction.')
        self.monomials -= {Monomial({}, 0)}
def __init__ ( self , monomials : Iterable [ Union [ int , float , Fraction , Monomial ] ] ) -> None : self . monomials = set ( ) for m in monomials : if any ( map ( lambda x : isinstance ( m , x ) , [ int , float , Fraction ] ) ) : self . monomials |= { Monomial ( { } , m ) } elif isinstance ( m , Monomial ) : self . monomials |= { m } else : raise ValueError ( 'Iterable should have monomials, int, float, or Fraction.' ) self . monomials -= { Monomial ( { } , 0 ) }