View the step-by-step solution to:

How would I code the function to add two polynomials. see below.

How would I code the function to add two polynomials... see below.



    idx1 = [4, 2, 1, 0]
    coef1 = [3, 2, 2, 5]

    idx2 = [3, 2, 1, 0]
    coef2 = [4, 3, 1, 2]

    add_coef(idx1, coef1, idx2, coef2) == [3, 4, 5, 3, 7]


I need help with this question.

Top Answer

def add_coef(idx1,coef1,idx2,coef2) : answer = [ ] ; for i in ( 0 , 4 ) : if (idx1[i] == idx2[i]) : temp =... View the full answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online