> def remove(self): > maxi = 0 > for i in range(1, len(self.items)): > if self.items[i] > self.items[maxi]: > maxi = i > item = self.items[maxi] > > return item > > My question concerns the remove function. The > function returns the maximum value. However, I'm > curious about self.items[maxi:maxi+1] = [].
Me too. Where did you find that line? > would he or she want to remove that value and the one > next to it (maxi+1)? Or am I misunderstanding > self.items[maxi:maxi+1] = [] ? Slicing does not include the top number, it works like range() Thus a slice [3:4] only includes [3] > As an aside, I can't figure out how to respond to > topics on this list. Use Reply-All... or if you don;t have that simply add the tutor address to the cc list. Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor