Respuesta :
Answer:
The program in Python is as follows:
mnths = ["january","february","march","april","may","june","july","august","september","october","november","december"]
days = int(input("Day: "))
month = input("Month: ")
if not(month.lower() in mnths):
print("Invalid")
else:
month_index = mnths.index(month.lower())
if month_index == 0:
if days<1 or days>31: print("Invalid")
else: print("Winter")
elif month_index == 1:
if days<1 or days>28: print("Invalid")
else: print("Winter")
elif month_index == 2:
if days<1 or days>31: print("Invalid")
elif days<= 19: print("Winter")
else: print("Spring")
elif month_index == 3:
if days<1 or days>30: print("Invalid")
else: print("Spring")
elif month_index == 4:
if days<1 or days>31: print("Invalid")
else: print("Spring")
elif month_index == 5:
if days<1 or days>30: print("Invalid")
elif days<= 20: print("Spring")
else: print("Summer")
elif month_index == 6:
if days<1 or days>31: print("Invalid")
else: print("Summer")
elif month_index == 7:
if days<1 or days>31: print("Invalid")
else: print("Summer")
elif month_index == 8:
if days<1 or days>31: print("Invalid")
elif days<= 21: print("Summer")
else: print("Autumn")
elif month_index == 9:
if days<1 or days>31: print("Invalid")
else: print("Autumn")
elif month_index == 10:
if days<1 or days>30: print("Invalid")
else: print("Autumn")
elif month_index == 11:
if days<1 or days>31: print("Invalid")
elif days<21: print("Autumn")
else: print("Winter")
Explanation:
See attachment for complete source file, where comments are used to explain difficult lines