"orangeDinosaur" <[EMAIL PROTECTED]> writes:

> Here's  a section of code:
>
> for x in occupants:
>                       if x not in uniqueUsers and not in staff: 
> uniqueUsers.append(x)
>                       elif x in staff and not in uniqueStaff: 
> uniqueStaff.append(x)
>
> When I try to import the module with the function definition that
> contains this code, I get a syntax error pointing to the 'in' after the
> 'and not in staff'.  I can't figure out why this is bad syntax.  Both
> 'uniqueUsers' and 'staff' are lists.  

The question is: "what's not in XXX"?  x?  Something else?  You hve to
remember that the computer does only what you tell it to do:

if x not in uniqueUsers and x not in staff: ...

I also prefer using parenthesis to make things more clear and avoid precedence
surprises. 

-- 
Jorge Godoy      <[EMAIL PROTECTED]>

"Quidquid latine dictum sit, altum sonatur."
- Qualquer coisa dita em latim soa profundo.
- Anything said in Latin sounds smart.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to