On a Call - Please send help I'm going insane.
So I can't grasp why the hell this attempt doesn't work. Base code (i filled the list so we don't need the add input) class CallCenter: def __init__(self): self.customers = ['general','general','technical','general'] 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() so the solution attempt is: time = 0 while not c.is_empty(): item = c.next() if item == 'general': time += 5 if item == 'technical': time += 10 print(time) so far so good, now my attempt before was: time = 0 while not c.is_empty(): if c.next() == 'general': time += 5 if c.next() == 'technical': time += 10 print (time) And i noticed that without the reassignment of the method c.next() to any kind of variable my attempt doesn't work. Any explanation?