Your code is on the right track! You did a fine job of thinking through the problem. A couple things:
- You're returning a string containing "True" or "False" instead of returning the actual Boolean value.
bool can be either
False, and there is no need for quotation marks.
What you're looking for is:
return True and
- Also, think about the definition of an
int. It can be any whole number, positive or negative. You're testing the number to see if the difference between the int and the float is a positive number, however; what if it is negative? For example, -3.4 rounds to -3 as an
int. Therefore, the difference would be -3.4 - (-3), which equals -0.4. This should return
False, but your code returns
True since the value is less than 0.
What you can do is use a different operator in your conditional statement. Instead of
> 0, try
This tests for positive and negative remainders when you do your subtraction.
Hope this helps!