## Nova polynomial add
This kata is from a series on polynomial handling. ( [#1](http://www.codewars.com/kata/nova-polynomial-1-add-1) [#2](http://www.codewars.com/kata/570eb07e127ad107270005fe) [#3](http://www.codewars.com/kata/5714041e8807940ff3001140 ) [#4](http://www.codewars.com/kata/571a2e2df24bdfd4e20001f5) )
Consider a polynomial in a list where each element in the list element corresponds to a factor. The factor order is the position in the list. The first element is the zero order factor (the constant).
`p = [a0, a1, a2, a3]` signifies the polynomial `a0 + a1x + a2x^2 + a3*x^3`
In this kata add two polynomials:
```python
poly_add ( [1, 2], [1] ) = [2, 2]
```
# return the sum of the two polynomials p1 and p2.  
def poly_add(p1, p2):
    # store the result here
    res = []
    longest_p = max(len(p1), len(p2))
    for i in range(longest_p):
        # add the two numbers together unless there is no number there, then just add 0 (don't change)
        res.append((p1[i] if i < len(p1) else 0) + (p2[i] if i < len(p2) else 0))
    return res
# return the sum of the two polynomials p1 and p2.  
def poly_add(p1, p2):
    # store the result here
    res = []
    longest_p = max(len(p1), len(p2))
    for i in range(longest_p):
        # add the two numbers together unless there is no number there, then just add 0 (don't change)
        res.append((p1[i] if i < len(p1) else 0) + (p2[i] if i < len(p2) else 0))
    return res