-3

How do I remove the square parenthesis from each element from the list For example if I have list = [['a'],['b'],['c'],['d'] how can I get an output ['a','b','c','d']

1 Answers1

0

You can try using a for loop. Code:

l = [['a'], ['b'], ['c'], ['d']]
new_l = []

for elem in l:
    new_l.append(elem[0])
abhigyanj
  • 2,355
  • 2
  • 9
  • 29