import math import numpy as np import calendar def main(): happy = 0 m1 = [4,6,9,11] #30日 for i in np.arange(1,13): if i == 2: for j in np.arange(1,29): count(i, j) elif i in m1: for j in np.arange(1,31): count(i, j) else: for j in np.arange(1,32): count(i, j) print(happy) def count(i, j): global happy sum = j//10 + j%10 #10の位と1の位を足す if i == sum: happy += 1 if __name__ == "__main__": main() # your code goes here