ed help fixing this python code so that it can display the outputs described in the image
I need help fixing this python code so that it can display the outputs described in the image below
:
input_month = input()
input_day = int(input())
months= ('January', 'February','March', 'April' , 'May' , 'June' , 'July' , 'August' , 'September' , "October" , "November" , "December")
if not(input_month in months):
print("Invalid")
elif input_month == 'March':
if not(1<=input_day<=31):
print ("Invalid")
elif input_day<=19:
print("Winter")
else:
print ("Spring")
elif input_month == 'April' :
if not(1<=input_day<=30):
print("Invalid")
else:
print("Spring")
elif input_month == 'May':
if not(1<=input_day<=31):
print("Invalid")
else:
print("Spring")
elif input_month == 'June':
if not(1<=input_day<=30):
print("Invalid")
elif input_day<=20:
print ("Spring")
else:
print("Summer")
elif input_month == 'July' or 'August':
if not(1<=input_day<=31):
print("Invalid")
else:
print("Summer")
elif input_month == 'September':
if not(1<=input_day<=31):
print("Invalid")
elif input_day<=21:
print ("Summer")
else:
print ("Autumn")
elif input_month == "October":
if not(1<=input_day<=31):
print("Invalid")
else:
print("Autumn")
elif input_month == "November":
if not(1<=input_day<=30):
print("Invalid")
else:
print ("Autumn")
elif input_month == "December":
if not(1<=input_day<=31):
print("Invalid")
elif input_day <=20:
print ("Autumn")
else:
print ("Winter")
elif input_month == 'January':
if not(1<=input_day<=31):
print("Invalid")
else:
print("Winter")
elif input_month == "February":
if not(1<=input_day<=29):
print("Invalid")
else:
print ("Winter")
Step by step
Solved in 3 steps with 5 images