for place in val:
for words in place:
```
The overlapping list eg.ist = [Seoul], [Daegu], and [Busan] are extracted and converted into strings like Seoul, Daegu, and Busan. I can't think of how to close the for door above.
Is there any other way besides that?
In [1]:ist = ["Seoul"], ["Daegu"], ["Busan"]
In [2]: ', '.join(item for l in ist for item in l)
Out[2]: 'Seoul, Daegu, Busan'
In [3]: import itertools
In [4]: ', '.join(itertools.chain(*ist))
Out[4]: 'Seoul, Daegu, Busan'
I can think of two ways.
© 2024 OneMinuteCode. All rights reserved.