Possible Duplicate:
Convert list of tuples to list?
I have a list like this
[('Knightriders',), ('The Black Knight',), ('Fly by Knight',), ('An Arabian Knight',), ('A Bold, Bad Knight',)...]
I want to convert this to :
['Knightriders', 'The Black Knight', 'Fly by Knight', 'An Arabian Knight', 'A Bold, Bad Knight',...]
What is the least time consuming way to accomplish this ?
simplest one is using a list comprehension:
or using
itemgetter:or:
or using
zip()as suggested by @DSM:or using
ast.literal_eval(least recommended solution or may be never try this):