I know how to use both for loops and if statements on ... You can use generator expressions like this:
stackoverflow.com