Question: PYTHON QUESTION 1. Suppose you have a tuple that stores the semester and year a course was taken, as in when - ('Spring',2015) Write a
PYTHON QUESTION

1. Suppose you have a tuple that stores the semester and year a course was taken, as in when - ('Spring',2015) Write a function called earlier_semester() that takes two such tuples as arguments and returns True if the first tuple represents an earlier semester and False otherwise. The possible semesters are 'Spring'and Fall'.(Just to be clear, Fall 2013 is later than Spring 2013.) Test it using the following main code (you can cut-and-paste from the browser), which should be your only print function calls. # Insert your function def here w1Spring',2015) w2 'Spring',2014) w3'Fall', 2014) w4('Fall', 2015) print " earlier than ? ".format( w1, w2, earlier_semester(w1,w2))) print " earlier than ? ".format( w1, w1, earlier_semester(w1,w1))) print " earlier than ? format( w1, w4, earlier_semester(w1,w4))) print " earlier than .format( w4, w1, earlier_semester(w4,w1))) print " earlier than ? .format( w3, w4, earlier_semester(w3,w4))) print( " earlier than ?(".format( w1, w3, earlier_semester(w1,w3)))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
