Python: Join Tuple

The process of joining 2 or more tuple at a time is know as concatenation .As tuples are immutable the concatenation process is more complex. Concatenation is done with the use of + operator.

Example:

tup_1 = (1,2,3,4)
tup_2 = ('a','b','c','d')

res_tup = tup_1 + tup_2
print(res_tup)

Output:

(1, 2, 3, 4, 'a', 'b', 'c', 'd')
Tags