python for loop with if in one line