Saksham
0
Q:

string concatenation in python

x="String"
y="Python"
d="+"
c = "We can concatenation " + y + x + "with" + d + "Operator"
print(c)
1
# initializing string  
test_string = "GFG"
  
# initializing add_string 
add_string = " is best"
  
# printing original string  
print("The original string : " + str(test_string)) 
  
# printing original add string  
print("The add string : " + str(add_string)) 
  
# Using += operator 
# adding one string to another  
test_string += add_string 
4
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

New to Communities?

Join the community