使用列表代码如下:
month = int(input('month:'))
season = [[12,1,2],[3,4,5],[6,7,8],[9,10,11]]
if month in season[0][0:3]:
print('winter')
elif month in season[1][0:3]:
print('spring')
elif month in season[2][0:3]:
print('summer')
elif month in season[3][0:3]:
print('fall')
else:
print('not regular month')