月份与季节

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("输入啥呢??小老弟!!")

猜你喜欢

转载自www.cnblogs.com/NoteBook3013/p/10187103.html