python if statements with two conditions