Given polynomial, write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0 format in python code example
Example: Given polynomial, write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0 format.
def printPoly(poly, n):
for i in range(n):
print(poly[i], end="")
if (i != 0):
print(" x^", i, end="")
if (i != n - 1):
print(" + ", end="")
if __name__ == '__main__':
print(printPoly([5, 0, 10, 6], 4))