Last answered:

03 Oct 2019

Posted on:

03 Oct 2019

0

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)
Instructor
Posted on:

03 Oct 2019

0
Hi Alexis,   Thanks for reaching out!   The 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

Submit an answer