So my teacher wants us to design a short program to add 2 polynomials, asking the user for the degree and coefficients, and print out the new coefficients.
poly1 deg=2 coeff= 3 4 5
poly2 deg=2 coeff= 2 5 6
output would be: 5 9 11
however, sometimes one would have a higher degree.
I have written:
deg2=eval(input("enter 2nd degree"))
while count<= deg2+1:
coeff=eval(input("enter 2nd coefficient"))
all of it is ok until i come to establishing a max and adding them. i am a new programmer so i know my syntax is very bad. i am trying to determine the max and then use the last elements of each and add them, and then move the index of the list over to the left to add right to left.
any ideas? thanks
Edited 6 Years Ago by michaeljfox: n/a