What does a + b amount to if a is a tuple and b is 5?
1 Like
If a is tuple and b is 5 then a + b will raise a TypeError because it is not possible to concatenate a tuple with an integer.
For example:a = (1, 2)b = 5c = a + b
TypeError: can only concatenate tuple (not "int") to tuple
Answered By
What does a + b amount to if a and b are tuples?
What does a * b amount to if a and b are tuples?
Is a string the same as a tuple of characters?
Can you have an integer, a string, a tuple of integers and a tuple of strings in a tuple?