Input two strings in one line, separated by a space.
Concatenate the two strings and print out the result.
# 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)
Comments
Leave a comment