python if else in one line for loop