Say I have a bunch of variables that are either True or False. I want to evaluate a set of these variables in one if statement to see if they are
True
False
What about a custom function?
function ListObjectsEqualTo(myList, toValue): for i in myList: if i != toValue: return False return True
Now you can use it
if ListObjectsEqualTo((var1, var2, var3, var4), False): # do stuff
You can do:
if var1 and var2 and var3 and var4: do stuff