classMyCalendar(object):def__init__(self): self.calendar = []defbook(self,start,end):for s, e in self.calendar:if s < end and start < e:returnFalse self.calendar.append((start, end))returnTrue# Your MyCalendar object will be instantiated and called as such:# obj = MyCalendar()# param_1 = obj.book(start,end)