Why is int() not rounding to the nearest whole number?
when we write any decimal with int why the comes with small whole number
e.g int (4.9)
out 4
why the output doesn't come nearest whole number
e.g int (4.9)
out 5
1 answers ( 0 marked as helpful)
Hi Alexis,
Thanks for reaching out!
The
The 365 Team
int()
function returns the integer part of a real number.
If you want the nearest integer number, you can use the round()
function:
Best,The 365 Team