Practice Makes Perfect


#1



It gives me an error saying "Oops, try again. by_three(3) returned False instead of 27"

I thought i done everything correctly. Please can you help me.


def cube(number):
    cube = number*number*number
    print cube
    return cube 

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

by_three(3)


#2

if the number is divisible by 3, you should return the cube, not print it:

return cube(number)

#3

Thank you very much stetim94. It worked when i changed it :wink: