i'd like to do a recursive read on lists
for example, I have the following:
[x if x % 2 == 0 else [a for a in [9,8,7]] for x in [2,3,4,5]]
And the output is:
[2, [9, 8, 7], 4, [9, 8, 7]]
But I'd like it to be:
[2, 9, 8, 7, 4, 9, 8, 7]
Is it possible?
I've tried
[x if x % 2 == 0 else a for a in [9,8,7] for x in [2,3,4,5]]
And didn't work [2, 9, 4, 9, 2, 8, 4, 8, 2, 7, 4, 7]
Thanks in advance.