Possible glitch?


Course stuck on

Oops, try again. by_three(4) returned 64 instead of False
This is the error message i have a problem with.
I cannot be sure. I am trying to solve this lesson and can't move on until this is fixed.

I expected the editor to accept this code and not give an error message.

def cube(number):
    return number*number*number

def by_three(number):
    if number / 3 or number == 3:
        return cube(number)
        return False`Preformatted text`


instead of if number/3 or number==3:
it sohould be if number%3==0 or number ==3:


this is because it is checking if it can be divided with no remainder


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.