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]
?
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]
?
You could also merge both lists into c
using the addition operator. For example:
c = a + b