c=0 for d10 in range(3): for d1 in range(10): if 1 <= d10 + d1 <= 12: c = c + 1 c = c + 1 print(c)