def choix(stats): r = random() * sum(stats.values()) s = 0 n = 0 for k in stats: s += stats[k] if s>=r: return k