6. Practice Makes Perfect


#1

I am stuck at 7. Functions, 6. Practice Makes Perfect

I am receiving the message: "Oops, try again. cube(1) resulted in an error: unsupported operand type(s) for ** or pow(): 'function' and 'int'"

It should return 3


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

    number(3)

Please, let me know what I am doing wrong :slight_smile:


#2

This should be using the value passed to the parameter, number:

number ** 3

#3

Thank you SO much!

I have been racking my brain for ages on that. Much appreciated :slight_smile:


#4

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