Question: #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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
