Practice makes perfect - stuck


Hi Guys

Please help, I cannot seem to figure out what is going wrong here. I've had a look at similar posts but alas no bananas. commentary would be appreciated.

Oops, try again. cube(2) returned 4 instead of 8


def cube(number):
    return number ** 2

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


Did you call by_three() function at the end with some number in it ?


The cube of a number is a number raised to the power of three like,

4 ** 3 # This is 4 cubed



@dayfiri I have yes

@bandit Thanks so much, I looked at this over and over and didn't click! It works now!


You're welcome :slight_smile:


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