Say all of w, x, y, and z can be in list A. Is there a shortcut for checking that it contains only x--eg. without negating the other variables?
w, x, y, and z
That, or if you don't want to deal with a loop:
>>> a = [w,x,y,z] >>> a.count(x) == len(a) and a
(and a is added to check against empty list)
and a