Concatenation of Tuples in Python

Examples of concatenation of tuple:

Method 1

tup1 = (1, 2, 3)
tup2 = (4, 5, 6)

res = tup1 + tup2

print("Result is : " + str(res))
Method 2

tup1 = (1, 2, 3)
tup2 = (4, 5, 6)

res = sum((tup1, tup2), ())

print("Result is : " + str(res))

Software Engineer | Ethical Hacker & Cybersecurity...

Md Obydullah is a software engineer and full stack developer specialist at Laravel, Django, Vue.js, Node.js, Android, Linux Server, and Ethichal Hacking.