Complex compound expressions

Derek Basch dbasch at
Fri Aug 16 18:15:54 EDT 2002

Just a quick question. I am still a little shaky on
using parentheses to form complex compound
expressions. For example:

if character in string.letters or string.digits:
            print 'im a character'

this prints 'im a character' for every character
including digits and whitespaces. I can get the
desired result by using this expression:

if character in string.letters or character in
           print 'im a character'

However, I know that there must be a way to use a
parentheses on the top statement and get the same
result. Can anyone help me out here?
Derek Basch

Do You Yahoo!?
HotJobs - Search Thousands of New Jobs

More information about the Python-list mailing list