python concatenate string format code example
Example 1: python concatenate strings
x = ‘apples’
y = ‘lemons’
z = “In the basket are %s and %s” % (x,y)
Example 2: python compressed for concatenate string
LIST = [ 'a', 'b', 'c' ]
text = ' '.join(x for x in LIST)
print(text)
# OUTPUT
'a b c'