Programming for Mathematics Assignment, 27 August 2014 Write a Python class Polynomial that stores polynomials in a single variable x with integer coefficients: for instance, 3x^4 - 17x^2 - 3x + 5. Choose a suitable internal representation. - For instance each term of the polynomial can be represented as a pair of integers (coefficient,exponent) and the polynomial could itself be a list of such pairs. - Or you could use a dictionary where the key is the exponent and the value is the coefficient. Your representation should store only terms with non-zero coefficients. a. The function __init__ should accept an initial polynomial of in the list format: i.e. [(coeff1,expo1),(coeff2,expo2),...,(coeffn,expon)] Assume that the terms could be in any order, possibly with repeated exponents, in which case the corresponding coefficients should be added up. b. Define "magic functions" __add__ and __mul__ to add and multiply two polynomials. c. Define __str__ that displays the polynomial in human readable form. Print the terms in some canonical order (e.g. in descending order of exponents) d. Define __repr__ that returns a string of the form "Polynomial([(coeff1,expo1),(coeff2,expo2),...,(coeffn,expon)]" e. Define functions getcoeff(exponent) and setcoeff(exponent) to get and set the coefficients of a particular term. Make sure these work sensibly if there is currently no term with that exponent. f. Anything else you think is interesting! ======================================================================