def P(E): global U return sum(loi[x] for x in E)