season=int(input("请输入一个数字,表示月份:\n")) if season2 or season3 or season4: print(season,"月属于春天。\n") elif season5 or season6 or season7: print(season,"月属于夏天。\n") elif season8 or season9 or season10: print(season,"月属于秋天。\n") elif season11 or season12 or season1: print(season,"月属于冬天。\n") else: print("您输入的这个月份不存在,请重新输入。\n")

2 条评论

  • @ 2024-6-6 18:25:56

    你为啥玩Python,不玩C++?

    • @ 2024-8-10 23:06:52

      咋的,Python就不让进这个网站了?

  • @ 2024-3-18 16:12:38

    没有分行,代码高手自己判断,season和数字之间少了“==”,请自己脑补,谢谢。

  • 1