MCQ Hive stays free thanks to ads. Please disable your ad blocker for this site so content and features keep working.
Data Types
Type Conversion & Casting
Beginner
Q
What is int(-3.7) in Python?
A-4
B-3.7
C-3
DValueError
Correct Answer:
C. -3
Explanation:
int() truncates toward zero. math.floor(-3.7) would give -4.
ALSO KNOW (related points):
• What is the value of (int)3.99 in C++? → 3
• What is bool("False") in Python? → True
• What is the result of 4 / 2 in Python 3? → 2.0