Computer Science

Find the output generated by following code fragments :

T4 = (17)  
type(T4)

Python Tuples

2 Likes

Answer

Output
<class 'int'>  
Explanation

Since no comma is added after the element, so even though it is enclosed in parenthesis still it will be treated as an integer, hence T4 stores an integer not a tuple.

Answered By

2 Likes


Related Questions