How to Concatenate Tuples in Python?


For those wondering how to concatenate two tuples in Python, the + operator can be used to do it.

Example:

tuple1 = ("a", "b" , "c")

tuple2 = (1, 2, 3)

tuple3 = tuple1 + tuple2

print(tuple3)

Output:

(‘a’, ‘b’, ‘c’, 1, 2, 3)


Leave a Reply

Your email address will not be published. Required fields are marked *