python if statement in one line for loop