Write Python functions for the following operations:
that add and multiply two polynomials, respectively.
You may assume that the inputs to these functions follow the representation given above. Correspondingly, the outputs from these functions should also obey the same constraints.
Hint: You are not restricted to writing just the two functions asked for. You can write auxiliary functions to "clean up" polynomials --- e.g., remove zero coefficient terms, combine like terms, sort by exponent etc. Build a library of functions that can be combined to achieve the desired format.
You may also want to convert the list representation to a dictionary representation and manipulate the dictionary representation, and then convert back.
[(2, 1),(3, 0)]
Explanation: (4x^3 + 3) + (-4x^3 + 2x) = 2x + 3
Explanation: 2x + (-2x) = 0
[(1, 3),(-1, 0)]
Explanation: (x - 1) * (x^2 + x + 1) = x^3 - 1