Checking for keywords in several lists
Alex Martelli
aleax at aleax.it
Thu Jan 24 10:09:40 EST 2002
"Heiko Wolf" <heiko.wolf at dlr.de> wrote in message
news:d013da35.0201240629.2e4af237 at posting.google.com...
...
> > for function, wordlist in (
> > dosomething, ('word1', 'word2', 'word3'),
> > dosomethingelse, ('word4', 'word5'),
...
> I tried your approach, but it hit me with a TypeError.
>
> for function, wordlist in (
> TypeError: unpack non-sequence
Sorry, I had omitted one level of parentheses -- it's:
for function, wordlist in (
(dosomething, ('word1', 'word2', 'word3')),
(dosomethingelse, ('word4', 'word5')),
etc etc.
Alex
More information about the Python-list
mailing list