Python Check If Multiple Variables Solver