def num_happy_day(): month = [] day = [] num = 0 for i in range(1,13): month.append(i) for i in range(1,32): day.append(i) for left in month: for right in day: if left == 2 and right == 29: print("2 break") break elif (left == 4 and right == 31) or (left == 6 and right == 31) or (left == 9 and right == 31) or (left == 11 and right == 31): print("samurai break") break else: right_ten = right // 10 right_digit = right % 10 if left == right_ten + right_digit: num += 1 print(left,right) return num print(num_happy_day())