Syntax Error Help


I keep getting the error:
Oops, try again. by_three(3) resulted in an error: global name 'result' is not defined

def cube(number):
result = number**3
return result

def by_three(number):
if (number % 3) == 0:
return result

    return False


The variable result is local to the cube() function, and does not exist in the context of by_three(). Simply return the return value...

return cube(number)

This will call the cube() function on number, and the return statement will return the result.