salut,

une méthode que je trouve à titre personnel élégante et/ou résolument pythonesque :

bits = [0 if 20 <= b <= 28 else 1 for a, b in data if a == 1 and (20 <= b <= 28 or 65 <= b <= 75)]
la...