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
This checks that all elements in A are equal to x without reference to any other variables:
element
A
x
all(element==x for element in A)