CBSE Class 11 Computer Science Question 71 of 114

Tuples — Question 8

Back to all questions
8
Question

Question 1(h)

Find the output generated by following code fragments :

t3 = ('a',)	  
type(t3)
Answer
Output
<class 'tuple'> 
Explanation

Since 'a' is enclosed in parenthesis and a comma is added after it, so t3 becomes a single element tuple instead of a string.