def pol_eval(p, x) -> float:
    """ evaluate polynomial from coefficients p : p[0] + p[1]*x + p[2]*x**2 + ... """
    if not isinstance(p,(list,tuple)):
        p = [p]
    
    y = p[-1]
    for i in range(len(p)-2,-1,-1):
        y = p[i] + y*x
    return y