Answers for "concatenate a list"

28

Concatenate Item in list to strings

>>> sentence = ['this','is','a','sentence']
>>> '-'.join(sentence)
'this-is-a-sentence'
Posted by: Guest on April-11-2020
5

add two list in python

list1 = ["a", "b" , "c"]
list2 = [1, 2, 3]

list1.extend(list2)
print(list1)
Posted by: Guest on May-17-2020

Python Answers by Framework

Browse Popular Code Answers by Language