Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#Create one tuple for storing the months... monthTuple = ( ' January ' , 'February','March', 'April', 'May', 'June', 'July', 'August', 'September', October, November, December )
#Create one tuple for storing the months... monthTuple January 'February','March', 'April', 'May', 'June', 'July', 'August', 'September', "October", "November", "December" #Check if the userMonth is not in monthTuple then print the Invalid... if notuserMonth in monthTuple: printInvalid #Check for the March month with userDay... elif userMonth 'March': if not userDay : printInvalid elif userDay : printWinter else: printSpring #Check for the April month with userDay... elif userMonth 'April' : if not userDay : printInvalid else: printSpring #Check for the May month with userDay... elif userMonth 'May': if not userDay : printInvalid else: printSpring #Check for the June month with userDay... elif userMonth 'June': if not userDay : printInvalid elif userDay : printSpring else: printSummer #Check for the July month with userDay... elif userMonth 'July': if not userDay : printInvalid else: printSummer #Check for the August month with userDay... elif userMonth 'August': if not userDay : printInvalid else: printSummer #Check for the September month with userDay... elif userMonth 'September': if not userDay : printInvalid elif userDay : printSummer else: printAutumn #Check for the October month with userDay... elif userMonth "October": if not userDay : printInvalid else: printAutumn #Check for the November month with userDay... elif userMonth "November": if not userDay : printInvalid else: printAutumn #Check for the December month with userDay... elif userMonth "December": if not userDay : printInvalid elif userDay : printAutumn else: printWinter #Check for the January month with userDay... elif userMonth 'January': if not userDay : printInvalid else: printWinter #Check for the February month with userDay... elif userMonth "February": if not userDay : printInvalid else: printWinter
#Create one tuple for storing the months...
monthTuple January 'February','March', 'April', 'May', 'June', 'July', 'August', 'September', "October", "November", "December"
#Check if the userMonth is not in monthTuple then print the Invalid...
if notuserMonth in monthTuple:
printInvalid
#Check for the March month with userDay...
elif userMonth 'March':
if not userDay :
printInvalid
elif userDay :
printWinter
else:
printSpring
#Check for the April month with userDay...
elif userMonth 'April' :
if not userDay :
printInvalid
else:
printSpring
#Check for the May month with userDay...
elif userMonth 'May':
if not userDay :
printInvalid
else:
printSpring
#Check for the June month with userDay...
elif userMonth 'June':
if not userDay :
printInvalid
elif userDay :
printSpring
else:
printSummer
#Check for the July month with userDay...
elif userMonth 'July':
if not userDay :
printInvalid
else:
printSummer
#Check for the August month with userDay...
elif userMonth 'August':
if not userDay :
printInvalid
else:
printSummer
#Check for the September month with userDay...
elif userMonth 'September':
if not userDay :
printInvalid
elif userDay :
printSummer
else:
printAutumn
#Check for the October month with userDay...
elif userMonth "October":
if not userDay :
printInvalid
else:
printAutumn
#Check for the November month with userDay...
elif userMonth "November":
if not userDay :
printInvalid
else:
printAutumn
#Check for the December month with userDay...
elif userMonth "December":
if not userDay :
printInvalid
elif userDay :
printAutumn
else:
printWinter
#Check for the January month with userDay...
elif userMonth 'January':
if not userDay :
printInvalid
else:
printWinter
#Check for the February month with userDay...
elif userMonth "February":
if not userDay :
printInvalid
else:
printWinter
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