Error Message


#1

Continuing the discussion from 6. Practice makes perfect:

This error message appears.
Oops, try again. Did you define a function called by_three?
here's code
def cube(number):
return number**3
def by_three(number):
if number % 3==0:
return cube(number)
else:
return False


#2

Hi in the error they aske you to call the function by_three() so try tot do that after your else statement

by_three(9)

#3

not working. can you send me the exact code to put so that i can see the mistake.? Thnx @wizmarco


#4

Hi this is how your code should be

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

#5

Yep worked. :slightly_smiling: