Test Index

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

© examsnet.com
Question : 1 of 102
Marks: +1, -0
State True or False :
In Python, data type of 74 is same as the data type of 74.0.
[CBSE 2026 Set 4]
Solution:  
Concept:
A whole number written without a decimal point is an integer (int); a number written with a decimal point is a floating point number (float), even if its fractional part is zero.
Explanation:
>>> type(74)
<class 'int'>
>>> type(74.0)
<class 'float'>
>>> type(74) == type(74.0)
False
So 74 is an int and 74.0 is a float: their data types are different and the statement is false.
Key point: 74 == 74.0 gives True because the values are equal, but the types are not the same.
Answer:
Option B (False)
© examsnet.com
Advertisements
Go to Question: