0

I have this list:

list1 = [('a', 'b'),('c', 'd')]

and I want to get a list that would look like this:

list2 = ['a', 'b', 'c', 'd']

I have this code but it gets list of lists instead.

list1 = [('a', 'b'),('c', 'd')]

list2 =[]               
for i in list1:
    i = list(i)
    list2.append(i)

How do make list2 a list of elements not lists?

leela.fry
  • 283
  • 2
  • 3
  • 13

0 Answers0