# seatingChartFunctions.py # A group of functions for making seating charts for the Granada Theatre # function inCenter # consumes: n, a integer (representing a seat number) # produces: True, if that seat is in the center of the theatre def inCenter(n): if (n>=100): return True else: return False def isEven(n): if n%2==0: return True else: return False # function seatLocation # consumes: n, a integer (representing a seat number) # produces: a string ("Right", "Left" or "Center") # depending on where the seat is located in the theatre def seatLocation(n): if isEven(n) and not inCenter(n): return "Right" elif not isEven(n) and not inCenter(n): return "Left" else: return "Center" # The void version of inCenter def isInCenter(n): if (n>100): print True else: print False # The void version of isEven def isItEven(n): if n%2==0: print True else: print False # The version of seatLocation that tries to reuse # the void functions, and doesn't work as a result def mySeatLocation(n): if isItEven(n) and not isInCenter(n): return "Right" elif not isItEven(n) and not isInCenter(n): return "Left" else: return "Center"