6 Practice makes perfect


#1

Need help. This is what I have so far.

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

    else: 
        return "False"

#2
def by_three(number):
    if by_three(number) % 3 ==0:

this is a recursion meaning your calling a function inside itself. So your basically trapped in a loop:

enter function -> enter if -> function call
    enter function -> enter if -> function call
        enter function -> enter if -> function call
            enter function -> enter if -> function call
                ... aso

So instead why not just use number%3 instead? And btw what do you expect by_three to do or what is the task it should perform? As this looks quite weird return by_three + cube(number) and this return "False" should probably a boolean and not a string but I'm just guessing maybe you could give some more information.