In Python, you can filter a list comprehension by adding an if statement to the end, e.g.:
[x for x in list if x<y]
I wish you could do the same in a for loop, e.g.:
for x in list if x<y:
...print(x)
In Python, you can filter a list comprehension by adding an if statement to the end, e.g.:
[x for x in list if x<y]
I wish you could do the same in a for loop, e.g.:
for x in list if x<y:
...print(x)