1) read this
, especially regarding code tags.
2) you can mix for and if in a single line easily, e.g.:
- Code: Select all
[(x*18,y) for (x,y) in zip(range(5), range(10,60,10)) if x % 2 == 0]
but it's hard from your post to understand what exactly you want and especially why do you need to put if and for in a single line.
What does your function return if the inner condition is never satisfied?
OOPS: metulburr beat me on this one:-).