Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 3 :

Advertisement

Detailed Solution

सही उत्तर है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

What does the following Python type-checking code output? / प्रकार जाँच वाले निम्नलिखित Python कोड का आउटपुट क्या है? print(type((5))) print(type((5,)))

1.
<class 'tuple'> <class 'tuple'>
2.
<class 'int'> <class 'int'>
3.
<class 'int'> <class 'tuple'>
4.
<class 'list'> <class 'tuple'>

Correct Answer: <class 'int'> <class 'tuple'>

(5) is just the integer 5 in parentheses, while the trailing comma in (5,) makes it a one-element tuple. / (5) केवल कोष्ठक में लिखा पूर्णांक 5 है, जबकि (5,) में पिछला अल्पविराम इसे एक-अवयवी टपल बनाता है।

Downloaded from PrepSnap (prepsnap.in)