Question #264945

Input two strings in one line, separated by a space.


Concatenate the two strings and print out the result.

Expert's answer

# Python program to demonstrate
# string concatenation
 
 

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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS