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)
my_list = ['a', 'b', 'c', 'd']
my_string = ','.join(my_list)
# Output = 'a,b,c,d'
# concatenating strings just means combining strings together
# it is used to add one string to the end of another
# below are two exmaples of how concatenation can be used
# to output 'Hello World':
# example 1:
hello_world = "Hello" + " World"
print(hello_world)
>>> Hello World
# example 2:
hello = "Hello"
print(hello + " World")
>>> Hello World
# use {}, where u want to place integer, or any other datatype.
# Use .formate at the end of string,
# and finally place data variable in parentheses
a = 123.1133
b = "Username"
c = True
print("a = {}".format(a))
print("b = {}".format(b))
print("c = {}".format(c))
two strings