1 month = input("请输入月份: ") 2 season = {"3":"春","4":"春","5":"春","6":"夏","7":"夏","8":"夏","9":"秋","10":"秋","11":"秋","12":"冬","1":"冬","2":"冬"} 3 weath = {"春":"不错,有点冷!!","夏":"光腚都感觉有点热!!","秋":"跟春天一样舒服!!","冬":"不多穿点会被冻死!!"} 4 5 if month in season: 6 print("你输入的是{0}月,属于{1}天,天气{2}".format(month,season.get(month),weath.get(season.get(month)))) 7 else: 8 print("输入啥呢??小老弟!!")