write a python program to add two polynomials.
Polynomial1 = 6x^3 + 10x^2 + 5
Polynomial2 = 4x^2 + 2x + 1
output
6x^3 + 14x^2 + 2x + 6
NOTE: Use string formatting to Display the Output
from sympy.abc import x
p1 = 6*x**3 + 10*x**2 + 5
p2 = 4*x**2 + 2*x + 1
print(p1 + p2)
Comments
Leave a comment