C-18-Q091mediumsingle_mcq
In Python, if y = int(2.8), what will print(y) output?
In Python, if y = int(2.8), what will print(y) output?
- a2.8
- b2
- c28
- d2.0
ব্যাখ্যা
int() converts a float to an integer by truncating toward zero, discarding the fractional part rather than rounding. So int(2.8) becomes 2.