Evaluative
Evaluative
DESCRIPTION
SOLUTION
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def evaluate_polynomial(coefficients, x):
result = 0
for i, coeff in enumerate(coefficients):
result += coeff * (x ** i)
return result
# Read input
coefficients = list(map(int, input().split())) # Read coefficients as a list of integers
x = int(input()) # Read the value of x
# Calculate the result
value_at_x = evaluate_polynomial(coefficients, x)
# Output the result
print(value_at_x)