List question

Dustan DustanGroups at
Sun Mar 23 14:19:22 CET 2008

On Mar 21, 3:57 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> From at home writes:
> >    if 'one' and 'two' in f:
> >            alist.append(f)
> Use:
>      if 'one' in f and 'two'  in f: ...

Personally, I would put parentheses around to be clearer:

if ('one' in f) and ('two'  in f): ...

I'm not saying to put parentheses around everything, but in the more
ambiguous cases, it certainly helps.

More information about the Python-list mailing list