Test Index

Python Revision Tour Get it on Google PlayDownload on the App Store CBSE Board Videos

© examsnet.com
Question : 71 of 102
Marks: +1, -0
For the following Python statement :
N = (25)
What shall be the type of N ?
[CBSE 2024 Compartment]
Solution:  
Concept:
Parentheses around a single value only group it; they do not make a tuple. A one-element tuple needs a trailing comma.
Explanation:
>>> N = (25)
>>> type(N)
<class 'int'>
>>> N = (25,)
>>> type(N)
<class 'tuple'>
So N = (25) is just the integer 25, and the type of N is Integer.
Answer:
Option A (Integer)
© examsnet.com
Advertisements
Go to Question: