I was doing the Is_Int section on Practice Makes Perfect, and from what I read from the instructions, I submitted:
if x - int(x) == 0:
Later on I found out that the more appropriate code probably is:
if x - round(x) == 0:
Now the question I have is, can anyone help explain to me why the first set of code would still be consider correct by Codeacademy(both are when I submit them)?
I checked and the int() function is suppose to convert strings and variables to integers. Whereas the round function actually rounds the numbers in the function, which would be more useful in this situation.
Any help would be appreciated.