Python Tuple Operations

Adding Tuples

To join Tuples use the + operator

Example: Joining Tuples

Python
set1 = ('A', 'B', 'C')
set2 = ('D', 'E', 'F')

all = set1 + set1   #  all = ('A', 'B', 'C', 'D', 'E', 'F')

Multiplying Tuples

You can create copies of a tuple by multipling the tuple by the number of copies you want.

Example: Multiplying Tuples

Python
set = ('A', 'B', 'C')

multiple = set1 * 3   #  all = ('A', 'B', 'C', 'A', 'B', 'C', 'A', 'B', 'C')