On Feb 10, 7:46 am, David Trémouilles <[EMAIL PROTECTED]> wrote:
> Hi,
>
>   Is there any better (shorter) way to negate a boolean list than:
>  >>> negated_boolean_list = [not elem for elem in boolean_list]
> ?
>
> I tried:
>  >>> map(not, boolean_list)
> but it seems that "not" is not a function.
>
> Thanks in advance,
>
> David

Try [not x for x in boolean_list]

- Paddy.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to