Computer Science

Carefully read the given code fragments and figure out the errors that the code may produce.

t1 = (3,)  
t2 = (4, 5, 6)  
t3 = t1 + t2  
print (t3)

Python Tuples

2 Likes

Answer

Output
(3, 4, 5, 6) 
Explanation

t1 is a single element tuple since comma is added after the element 3, so it can be easily concatenated with other tuple. Hence, the code executes successfully without giving any errors.

Answered By

1 Like


Related Questions