(self, variables: Dict[int, int], coeff: Union[int, float, Fraction, None]=None)
Create a monomial in the given variables:
        Examples:

            Monomial({1:1}) = (a_1)^1

            Monomial({
                1:3,
                2:2,
                4:1,
                5:0
            }, 12) = 12(a_1)^3(a_2)^2(a_4)

            Monomial({}) = 0

            Monomial({2:3, 3:-1}, 1.5) = (3/2)(a_2)^3(a_3)^(-1)
Create a monomial in the given variables:
        Examples:
Create a monomial in the given variables : Examples :
def __init__(self, variables: Dict[int, int], coeff: Union[int, float, Fraction, None]=None) -> None:
        '''
        Create a monomial in the given variables:
        Examples:

            Monomial({1:1}) = (a_1)^1

            Monomial({
                1:3,
                2:2,
                4:1,
                5:0
            }, 12) = 12(a_1)^3(a_2)^2(a_4)

            Monomial({}) = 0

            Monomial({2:3, 3:-1}, 1.5) = (3/2)(a_2)^3(a_3)^(-1)

        '''
        self.variables = dict()

        if coeff is None:
            if len(variables) == 0:
                coeff = Fraction(0, 1)
            else:
                coeff = Fraction(1, 1)
        elif coeff == 0:
            self.coeff = Fraction(0, 1)
            return

        if len(variables) == 0:
            self.coeff = Monomial._rationalize_if_possible(coeff)
            return

        for i in variables:
            if variables[i] != 0:
                self.variables[i] = variables[i]
        self.coeff = Monomial._rationalize_if_possible(coeff)
def __init__ ( self , variables : Dict [ int , int ] , coeff : Union [ int , float , Fraction , None ] = None ) -> None : self . variables = dict ( ) if coeff is None : if len ( variables ) == 0 : coeff = Fraction ( 0 , 1 ) else : coeff = Fraction ( 1 , 1 ) elif coeff == 0 : self . coeff = Fraction ( 0 , 1 ) return if len ( variables ) == 0 : self . coeff = Monomial . _rationalize_if_possible ( coeff ) return for i in variables : if variables [ i ] != 0 : self . variables [ i ] = variables [ i ] self . coeff = Monomial . _rationalize_if_possible ( coeff )