Practice makes perfect - stuck


#1


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.



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


success?


def cube(number):
    return number ** 2

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


#2

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


#3

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

4 ** 3 # This is 4 cubed

not,


#4

@dayfiri I have yes

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


#5

You're welcome :slight_smile:


#6

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