xxxxxxxxxx
my_list = ['a', 'b', 'c', 'd']
my_string = ','.join(my_list)
# Output = 'a,b,c,d'
xxxxxxxxxx
var1 = "Hello"
var2 = "World"
# join() method is used to combine the strings
print("".join([var1, var2]))
# join() method is used here to combine
# the string with a separator Space(" ")
var3 = " ".join([var1, var2])
print(var3)
xxxxxxxxxx
x = ‘apples’
y = ‘lemons’
z = “In the basket are %s and %s” % (x,y)
xxxxxxxxxx
x="String"
y="Python"
d="+"
c = "We can concatenation " + y + x + "with" + d + "Operator"
print(c)
xxxxxxxxxx
# The + operator can be used to concatenate two different strings.
x = "hello "
y = "world!"
# Concatenate two strings
print(x + y)
# OUTPUT: hello world!