On 09/25/2012 07:55 AM, Richard D. Moores wrote: > <snip> > > And why >>>> all([]) > True >>>> any([]) > False > >
Same problem as calling sum() with an empty list. What value should it have? Clearly, it should return its 'start' parameter, which defaults to zero. Well the all() has a start value of True, and ands that with each element of the iterable till one of them ends up with false. Similarly, the any() has a start value of False. -- DaveA _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor