On Tue, 15 Nov 2005 09:35:00 +0000, Simon Brunning wrote: > On 14/11/05, john boy <[EMAIL PROTECTED]> wrote: >> using the following program: >> >> prefixes = "JKLMNOPQ" >> suffix = "ack" >> for letter in prefixes: >> print letter + suffix >> if prefixes == "O" or "Q" > > Here you need: > > if prefixes == "O" or prefixes == "Q"
Or you could do this: if prefixes in ("O", "Q"): or even: if prefixes in "OQ": The first example compares prefixes with "O" and then "Q", the second looks to see if prefixes is a substring of "OQ". In this case, they will both have the same effect. -- Steven. -- http://mail.python.org/mailman/listinfo/python-list