Error returning number 6.practice makes perfect


#1



I am having trouble with the returning of the numbers in the functions.


Its supposed to return false, but codecademy returns the error message:' by_three(1) returned 1 instead of False'


def cube(number):
    return number**3

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


Anyways, I need help and I'm very stuck. Send help!


#2

here:

if (number / 3 ==0):

you should check if the number is divisible by 3, we can do this by checking if the remainder equals zero. This is done with modulo operator, not division operator which you are using


#4

Thank you! This helped me a lot and got me past the section.


#5