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
You could do:
if var1 == var2 == var3 == var4 == False: do_stuff()
But, if the variables evaluate to true or false, you could also do this:
if var1 and var2 and var3 and var4: do_stuff()
Or
if all([var1, var2, var3, var4]): do_stuff()