0
a=[1,2,3]
b=[4,5,6]
c=[]
c.append(a)
c.append(b)
print(c)

output:

[[1, 2, 3], [4, 5, 6]]

the code goes like this but how can I make c into [1,2,3,4,5,6]?

Yevhen Kuzmovych
  • 10,940
  • 7
  • 28
  • 48

1 Answers1

1

You could also merge both lists into c using the addition operator. For example:

c = a + b