combine list values python code example
Example 1: Concatenate Item in list to strings
>>> sentence = ['this','is','a','sentence']
>>> '-'.join(sentence)
'this-is-a-sentence'
Example 2: how to combine two lists in python
listone = [1,2,3]
listtwo = [4,5,6]
joinedlist = listone + listtwo
Example 3: how to combine two lists in python
l1 = ["a", "b" , "c"]
l2 = [1, 2, 3]
l1 + l2
>>> ['a', 'b', 'c', 1, 2, 3]