Practice make perfect

def cube(number):
    cubed = number ** 3
    return cubed
def by_three(number):
    if number % 3 == 0:
        return cube(number)
        return False
print cube(50)

see when i run this code even when the number is not divisible by 3 it performs the action cube(number) instead of printing false ?? anybody ??


Are you sure, that you are calling a correct function?


should i call by_three(50) ??


Yep. If you want it first to verify if number given is divisible by 3 then there's no other option


thanks man.. it worked :smile: