Possible glitch?


#1



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:
        cube(number)
        return cube(number)
    else:
        return False`Preformatted text`


#2

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


#3

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


#4

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