I'm in Functions 6. Practice makes perfect.

I need help, the error is:

Oops, try again. by_three(1) returned 'number is not' instead of False

My code is:

def cube(number):
return number**3
print number
def by_three(number):
if number % 3 == 0:
return "number is divisible by 3"
return True
return "number is not"
return False


a function ends the moment a return keyword is reached, because you return strings before the boolean values, the boolean values are never reached


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.