Python Check If Multiple Variables Equal A Value Used In This Formula