6/19 Plz help


#1

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

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

whats wrong with it?


#2

Oops, try again. cube(2) returned 2 instead of 8

this is what it says now


#4

yo @domdurkan im stuck and im sitting next to u. change your linx man.


#5

Make sure you indent correctly also there should be 1 "=" in the number == number**3 since its a variable we are setting its value to it and not checking to see if they are the same

def cube(number):
    result = number**3
    return result

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

#6

@ryebread4

Thanks so much!


#7

Thanks a lot been stuck for ages


#8

Another thanks to you Rybread 4 especially for pointing out the use of another variable result.


#9

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

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