Lesson 6. Practice Makes Perfect HELP



I'm getting the error "Oops, try again. by_three(1) resulted in an error: unsupported operand type(s) for %: 'function' and 'int'"

I'm not sure what's happening here. It's acting like division is not supported

def cube(number):
    return number*number*number
def by_three(number):
    if by_three % 3 == 0:
        return cube(number)
        return False

EDIT Solved! I was trying to divide the integer instead of the parameter. Got it now!


The name of the function (function is not a number) cannot be evaluated. Use the parameter, not the function name and this will work.


I got it, haha. I posted an edit :slight_smile:


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