Python Tuple - Concatenation Method

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:

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

>>> NewLevels = (5,6)

>>> UpdatedLevels=CodeComplexityLevels+NewLevels

>>> print(UpdatedLevels)

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

 

 


Copyright 2022 © pythontic.com