class SerieStat:
    def __init__(self,C,E):
        # C et E sont deux listes de mêmes dimensions
        if len(C) != len(E): print('Error : lists must have same dimensions')
        else: self.tab = dict(zip(C, E))
    def affiche(self):
        for key,value in self.tab.items():
            print(key,":",value)
    def moyenne(self):
        m,s = 0,0
        for key,value in self.tab.items():
            m += key * value
            s += value
        return m / s
    def var(self):
        R , F = [] , []
        m = self.moyenne()
        for key,value in self.tab.items():
            R.append( (key - m)**2 )
            F.append( value )
        return SerieStat(R,F).moyenne()
    def ecart(self):
        return self.var()**0.5