I want to do something like:
all = [ x for x in t[1] for t in tests ]
tests are as follows:
[ ("foo",[a,b,c]), ("bar",[d,e,f]) ]
So I want to get the result
all = [a,b,c,d,e,f]
My code is not working, Python says:
UnboundLocalError: local variable 't' referenced before assignment
Is there an easy way to do this?
python list-comprehension
Albert
source share