Q:

Python "and" and "or" if statement

In Python is it possible for me to code this and have it work as intended?
if a != None and b == None or a == None and b != None

basically I want to see if either a or b is None while the other isn't 

A:

Since it sounds like you want an xor...
if (a is None) != (b is None):
    ...

