count=0 x=[] y=[] for X in range(1,13): if X == 1 or 3 or 5 or 7 or 8 or 10 or 12: for Y in range(1,31): Y10=int(Y//10) Y1=Y%10 if X == Y10+Y1: count+=1 x.append(X) y.append(Y) elif X == 4 or 6 or 9 or 11: for Y in range(1,30): Y10=int(Y//10) Y1=Y%10 if X == Y10+Y1: count+=1 x.append(X) y.append(Y) else: for Y in range(1,28): Y10=int(Y//10) Y1=Y%10 if X == Y10+Y1: count+=1 x.append(X) y.append(Y) print(count,"\n") print(x,len(x),"\n") print(y,len(y),"\n")