Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_season(month):
- if month in [3, 4, 5]:
- return "Spring"
- elif month in [6, 7, 8]:
- return "Summer"
- elif month in [9, 10, 11]:
- return "Autumn"
- elif month in [12, 1, 2]:
- return "Winter"
- else:
- return "Invalid month number"
- def main():
- month_number = int(input("Enter the month number (1-12): "))
- season = get_season(month_number)
- print("The season for month", month_number, "is", season)
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement