[Tutor] Very basic question about lists

Kent Johnson kent37 at tds.net
Mon Dec 22 20:56:16 CET 2008


On Mon, Dec 22, 2008 at 1:33 PM, Eduardo Vieira <eduardo.susan at gmail.com> wrote:

> if 'arr' or 'bell' in item:

The interpreter sees this as
  if ('arr') or ('bell' in item):

'arr' always evaluates to True so the condition is always true. The
correct way to express this condition is
  if 'arr' in item or 'bell' in item:

Kent


More information about the Tutor mailing list