I use list comprehension in such a way that for each element I have 2 resulting values:
my_list = [10,20,30]
res_list = [ (x*2, x*3) for x in my_list ]
res_list # [(20, 30), (40, 60), (60, 90)]
But I need to have a flatten list, so I have to perform another comprehension:
res_list_1 = [yy for xx in res_list for yy in xx]
res_list_1 # [20, 30, 40, 60, 60, 90]
Is there any way to avoid this and get flat res_list
directly on the first comprehension?