Question: In Python 3.6 5. Dictionary: A polynomial can be represented by a dictionary. Write a function diff for differentiating such polynomials. diff takes a polynomial

In Python 3.6
5. Dictionary: A polynomial can be represented by a dictionary. Write a function diff for differentiating such polynomials. diff takes a polynomial as a dictionary argument and returns the dictionary representation of its the derivative. If p denotes the polynomial as a dictionary and dp a dictionary representing its derivative, we have Idplj-1]-j plj] for j running over all keys in p, except when j equals 0. Here is an example of the use of diff >>>p-to:-3, 3:2, 5:-1) diff (p) (2:6, 4:-5) In the above example, the dictionary p-to:-3,3:2,5:-1) means that the oth coefficient is -3, the 3rd coefficient is 2, and the 5th coefficient is -1 This can be written as (r)- +2a33
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
