Answers for "Given polynomial, write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0 format."

0

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))
Posted by: Guest on February-23-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language