Answers for "how can I add all the element of list of word in python?"

13

how can I add all the element of list of word in python?

l = ['aaa', 'bbb', 'ccc']

s = ''.join(l)
print(s)
# aaabbbccc

s = ','.join(l)
print(s)
# aaa,bbb,ccc

s = '-'.join(l)
print(s)
# aaa-bbb-ccc

s = '\n'.join(l)
print(s)
# aaa
# bbb
# ccc
Posted by: Guest on September-09-2020

Code answers related to "how can I add all the element of list of word in python?"

Python Answers by Framework

Browse Popular Code Answers by Language