Answered step by step
Verified Expert Solution
Question
1 Approved Answer
def get _ season ( month , day ) : month = month.lower ( ) if month not in [ ' january ' , 'february',
def getseasonmonth day:
month month.lower
if month not in january 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december':
return "Invalid"
seasons
"Spring":
"Summer":
"Autumn":
"Winter":
monthnum
"january": "february": "march": "april":
"may": "june": "july": "august":
"september": "october": "november": "december":
if month daymarch or month dayjune:
return "Spring"
elif month dayjune or month dayseptember:
return "Summer"
elif month dayseptember or month daydecember:
return "Autumn"
else:
return "Winter"
def main:
month inputEnter the month:
day intinputEnter the day:
season getseasonmonth day
if season "Invalid":
printInvalid month or day."
else:
printfThe season for monthday is season
if namemain:
main
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started