Practice Makes Perfect


When I run my code, it says this: Oops, try again. by_three(3) returned False instead of 27. Why is this happening with my code?

I expect the code to turn up as it divisible by three and the code to be accepted.

def cube(number):
    return number**3
def by_three(number):
    if number/3 == int:
        return cube(number)
        return False


>>> 3/3 == int
>>> 3/3 == float

Suggest using modulo % and test for zero remainder.


It works! Thank you.