Python Check If Multiple Variables Equal A Value Used In Formula