Custom Search

Wednesday, April 14, 2010

python list if in and or

python list if in and or

list
-----
CONTRIBUTORS = ['author', 'editor', 'translator', '']

PUBLISHERS = ['publisher', 'illustrator']

if in or
----------
if field in CONTRIBUTORS or field in PUBLISHERS:
print field


if in and
-------------
if field in CONTRIBUTORS and field in PUBLISHERS:
print field

No comments:

Post a Comment