Help with 6/19


#1

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

I don't completely understand this so I don't think I'm doing this right...I keep getting the error "Oops, try again. cube(2) returned 4 instead of 8"


#2

Oops nevermind! Lol, I realized I was supposed to cube the number instead of square it...my mistake. Plus I added a space between (number), **, and 2. So here's my fixed code, which passed the code checker...

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

Thank you to anyone who took the time to read this and maybe answer my question after I started writing this, and sorry I took up a post that wasn't needed :sweat_smile: