how to add strings in python code example
Example 1: concardinate str and a variable in python
print("the number is five " + str(5))
Example 2: how to append string to another string in python
string1 = "str"
string2 = "ing"
string3 = string1 + string2
print(string1 + string2)
string3 = f"{string1}{string2}"
Example 3: python concatenate strings
x = ‘apples’
y = ‘lemons’
z = “In the basket are %s and %s” % (x,y)
Example 4: how to add strings in tuple in python
First, convert tuple to list by built-in function list().
You can always append item to list object.
Then use another built-in function tuple() to
convert this list object back to tuple.
You can see new element appended to original tuple representation.
by tutorialspoint.com
happy coding :D
Example 5: python add strings
var1 = "foo"
var2 = "bar"
var3 = var1 + var2
Example 6: python merge strings
my_list = ['a', 'b', 'c', 'd']
my_string = ','.join(my_list)