Where do i make mistake in these codes? As my codes have passed all tests except one.Any hint or help here?
You are making a call center application, which should handle customers in a queue. The CallCenter class is implemented as a Queue. Each element of the queue has the topic of the call as its value. The two possible values are 'general' and 'technical'. A 'general' call takes on average 5 minutes to handle, while a 'technical' call requires 10 minutes. The given code adds multiple customers to the Queue from user input. You need to dequeue all added customers, calculate and output the total time required to handle all calls. I tried to resolve it but my codes still fail to pass one test. Can anyone assist to point out what my codes miss to fulfil all the tests in this assignment ? class CallCenter: def __init__(self): self.customers = [] def is_empty(self): return self.customers == [] def add(self, x): self.customers.insert(0, x) def next(self): return self.customers.pop() c = CallCenter() gcount=0 tcount=0 while True: n = input() if n == 'end': break c.add(n) c.next() if n=='general': gcount+=1 #print(gcount) tg_time=gcount*5 elif n=='technical': tcount+=1 #print(tcount) tt_time=tcount*10 ttg_time=tg_time+tt_time print(ttg_time)