def espva(...,...): E=... for i in range(...): E=...+...*P[i] return(...)