>>>>> John Machin <sjmac...@lexicon.net> (JM) wrote:

>JM> On Apr 16, 8:14 am, Chris Rebert <c...@rebertia.com> wrote:
>>> 
>>> def all_same(lst):
>>>     return len(set(lst)) == 1
>>> 
>>> def all_different(lst):
>>>     return len(set(lst)) == len(lst)

>JM> @ OP: These are very reasonable interpretations of "all same" and "all
>JM> different" but of course can both return False for the same input.

They can even both return True for the same input!
-- 
Piet van Oostrum <p...@cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to