Oops, try again. by_three(3) returned 3 instead of 27


#1




Oops, try again. by_three(3) returned 3 instead of 27


Submit to be successful


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


#2

As first, you must check if the number is not dividable by 3.

if not ( expression ):

As secondary, you should do as the instructions said

by_three should call to cube(number) and return its result.

So, remember to return cube(number) in line 7 instead if calling to it. :slight_smile:


#3

Hi papusalaatti,

Thank you for your response, this helped me complete the task.

One thing to note, the question asks to check if it is divisible by 3, not that it is not divisible by 3, however thank you for finding that I didn't return the function but called it :slight_smile:


#4

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