<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Debug the following code to print out the result of the polynomial.
polynomial equation: f(x) = x³ + 5x - 62
x = 9<|im_end|>
<|im_start|>assistant
"""
Debug the following code to print out the result of the polynomial.
"""

def evaluate_polynomial(coefficients, x):
    result = 0
    for i in range(len(coefficients)):
        result += coefficients[i] * (x ** (len(coefficients) - i - 1))
    return result

coefficients = [1, 5, -62]
x = 9

print(evaluate_polynomial(coefficients, x)) # 390<|im_end|>
