KnowledgeBoat Logo

Computer Science

Find the output generated by following code fragments :

t2 = (4, 5, 6)  
t3 = (6, 7)  
t4 = t3 + t2  
t5 = t2 + t3		  
print(t4)	  
print(t5)

Python Tuples

1 Like

Answer

Output
(6, 7, 4, 5, 6)
(4, 5, 6, 6, 7)
Explanation

Concatenate operator concatenates the tuples in the same order in which they occur to form new tuple. t2 and t3 are concatenated using + operator to form tuples t4 and t5.

Answered By

1 Like


Related Questions