In this python tuple program, we will concatenate two tuples.
Steps to solve the program
- Take two tuples as input.
- Concatenate the two tuples using the ” + ” operator.
- Print the output.
tup1 = ('s','q','a')
tup2 = ('t','o','o','l')
print(f"Original tuple: {tup1} {tup2}")
result = tup1+tup2
print("Combined tuple: ",result)
Output :
Original tuple: ('s', 'q', 'a') ('t', 'o', 'o', 'l')
Combined tuple: ('s', 'q', 'a', 't', 'o', 'o', 'l')