def E(loi): accumulateur = 0 for k in range(len(loi)): accumulateur = accumulateur + k*loi[k] return accumulateur