Python Tutorials
Basic

Data Structure and Data Types

String

List

Tuple

Set

Dictionary

Functions / Methods

Advance

Exception Handling

Python Join Tuple


Join Tuples Using Plus Sign

Join tuples using the arithmetic plus (+) sign.

Example
colors_tuple_1 = ("Red", "Blue")
colors_tuple_2 = ("Green",)

colors_tuple_3 = colors_tuple_1 + colors_tuple_2

print(colors_tuple_3)
('Red', 'Blue', 'Green')

In the above example, we are joining two different tuples using the plus (+) sign and assigning those added tuples to another tuple variable. Accordingly, both tuple items are present in the third join tuple.


Multiply Tuples

Using the multiplication (*) sign, you can repeat items in a tuple several times.

Example
colors_tuple = ("Red", "Blue")

new_colors_tuple = colors_tuple * 2

print(new_colors_tuple)
('Red', 'Blue', 'Red', 'Blue')

In the output, colors are repeated twice after multiplying the color tuple by two.