I’ve got this code. true_var and other_true_var are boolean values. The four conditional branches are distinct.
if true_var && other_true_var:
# do something 0
else if true_var && not other_true_var:
# do something 1
else if not true_var && other_true_var:
# do something else
else:
# both are false, do a crazy thing
Is there an “accepted” way to write this? I could pull all the conditionals into methods which return a boolean, but that seems over the top.
I would do it as follows for minimum number of tests: