Jim Cain
0
Q:

python concatenate strings

x="String"
y="Python"
d="+"
c = "We can concatenation " + y + x + "with" + d + "Operator"
print(c)
1
print “{0} {1} is {2} years old.” format(fname, lname, age)
1
x = ‘apples’
y = ‘lemons’
z = “In the basket are %s and %s” % (x,y)
1

x = "Python is "
y = "awesome"
z =  x + y

print(z)
 
0
LIST = [ 'a', 'b', 'c' ]
text = ' '.join(x for x in LIST)
print(text)

# OUTPUT
'a b c'
0

New to Communities?

Join the community