Polynomials

  • + 0 comments

    try:

    coefficients = list(map(float , input().strip().split()))
    
    
    x = int(input().strip())
    
    
    result = 0
    degree = len(coefficients) - 1  
    
    for i, coeff in enumerate(coefficients):
        result += coeff * (x ** (degree - i))  
    
    
    print(result)
    

    except ValueError as e: print(f"Input error: {e}")