How can I append a tuple into another tuple in Python?

PythonProgramming

You can directly add a tuple to another tuple using a + operator. For example,

Example

x = (1, 2, 3)
y = (4, 5)
x = x + y
print(x)

Output

This will give the output

x = (1, 2, 3)
y = (4, 5)
x = x + y
raja
Published on 18-Apr-2018 14:50:04
Advertisements