def cree(): return [0] * 6 def contient(s, x): if x < 1 or x > 366: return False paquet = x // 64 bit = x % 64 return s[paquet] & (1 << bit) != 0 def ajoute(s, x): if x < 1 or x > 366 raise ValueError("date " + str(x) + " invalide") paquet = x // 64 bit = x % 64 s[paquet] = s[paquet] | (1 << bit)