how to make if statement in a for loop in one line python code example Example: making lists with loops in one line python print([i for i in range(10)])