KnowledgeBoat Logo

Computer Science

Find the output generated by following code fragments :

t3 = ('a',)	  
type(t3)

Python Tuples

3 Likes

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.

Answered By

1 Like


Related Questions