Computer Science

What does a + b amount to if a and b are tuples?

Python Tuples

1 Like

Answer

Given a and b are tuples, so in this case the + operator will work as concatenation operator and join both the tuples.

For example:
a = (1, 2, 3)
b = (4, 5, 6)
c = a + b

Here, c is a tuple with elements (1, 2, 3, 4, 5, 6)

Answered By

1 Like


Related Questions