combining two if statements in python