Nick Ayres
0
Q:

python merge two list

listone = [1,2,3]
listtwo = [4,5,6]

joinedlist = listone + listtwo
6
# Makes list1 longer by appending the elements of list2 at the end.
list1.extend(list2)
4
import itertools
a = [['a','b'], ['c']]
print(list(itertools.chain.from_iterable(a)))
1
l1 = ["a", "b" , "c"]
l2 = [1, 2, 3]
l1 + l2
>>> ['a', 'b', 'c', 1, 2, 3]
1
StringName = "seperator".join(ListName)

# Seperator denotes character between each of the joined list elements
0

New to Communities?

Join the community