My List is :
[['kukatpally'], ['gachibowli'], ['Madhapur'], ['Chintal'],........]
I want to show like this
['kukatpally', 'gachibowli', 'Madhapur', 'Chintal',....]
so how to delete those '[' and ']' symbols..
Thanks in advance
My List is :
[['kukatpally'], ['gachibowli'], ['Madhapur'], ['Chintal'],........]
I want to show like this
['kukatpally', 'gachibowli', 'Madhapur', 'Chintal',....]
so how to delete those '[' and ']' symbols..
Thanks in advance
Use itertools.chain :
import itertools
l = [['kukatpally', 'somethingelse'], ['gachibowli'], ['Madhapur'], ['Chintal']]
list(itertools.chain(*l))
>> ['kukatpally', 'somethingelse', 'gachibowli', 'Madhapur', 'Chintal']
Or itertools.chain.from_iterable
import itertools
l = [['kukatpally', 'somethingelse'], ['gachibowli'], ['Madhapur'], ['Chintal']]
list(itertools.chain.from_iterable(l))
>> ['kukatpally', 'somethingelse', 'gachibowli', 'Madhapur', 'Chintal']