#月の日数 m_28 = 2 m_30 = [4,6,9,11] m_31 = [1,3,5,7,8,10,12] count = 0 # HAPPY DAYの数 for i in range (1,28): if 1 <= i <= 9: if i == 2: count += 1 if 10 <= i: i = str(i) if int(i[0])+int(i[1]) == m_28: count +=1 for i in range (1,30): if 1 <= i <= 9: if i == 4 or 6 or 9: count += 1 if 10 <= i: i = str(i) if int(i[0])+int(i[1]) == 4 or 6 or 9 or 11: count +=1 for i in range (1,31): if 1 <= i <= 9: if i == 1 or 3 or 5 or 7 or 8 : count += 1 if 10 <= i: i = str(i) if int(i[0])+int(i[1]) == 1 or 3 or 5 or 7 or 8 or 10 or 12: count +=1 print(count)