Python Tuple - concatenation method

To concatenate two tuples in python invoke the plus(+) operator with the two tuple objects as operands.

Tuple Updated 19 Sep 2016 1 min read

Method Name

Concatenation Operator (+)

Method Overview

In Python to concatenate two tuples and produce a new tuple use the + operator ie.., concatenation operator.

Operands

Tuple1 - The first python tuple to be concatenated

Tuple1 - The second python tuple to be concatenated

Usage:

Tuple1 + Tuple2

Example

python
>>> CodeComplexityLevels = (1,2,3,4)

>>> NewLevels = (5,6)

>>> UpdatedLevels=CodeComplexityLevels+NewLevels

>>> print(UpdatedLevels)

(1, 2, 3, 4, 5, 6)