Usefulness of the "not in" operator

Grant Edwards invalid at invalid.invalid
Sat Oct 8 11:28:17 EDT 2011


On 2011-10-08, Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
> candide wrote:
>
>> So what is the usefulness of the "not in" operator ? Recall what Zen of
>> Python tells
>> 
>> There should be one-- and preferably only one --obvious way to do it.
>
> And "not in" is the obvious way to do it.
>
>
> "If the key is not in the ignition, you won't be able to start the car."
>
> "If not the key is in the ignition, you won't be able to start the car."
>
>
> Who like that second one speaks?

Yoda.

-- 
Grant Edwards               grant.b.edwards        Yow! ... I don't like FRANK
                                  at               SINATRA or his CHILDREN.
                              gmail.com            



More information about the Python-list mailing list