Functions.S7!Please check my code


Here is a link to the exercise.

Here is the error message:
File “python”, line 5
return cube(number)
IndentationError: unindent does not match any outer indentation level

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


Hi @dextren5, look here:

Did you see the error? Python is saying that return(cube) (and return False) doesn’t match any other indentation level.
Have you read on indentation/white space? What we want to execute --if true-- should be indented under our if/elif/else statements. Do you know what I mean?


Thank you! I can’t believe I missed that…I feel stupid.Indentation AFTER if/elif/else!


Sure you’re welcome. Don’t feel stupid, we all make mistakes sometimes :wink:


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