Syntax error

https://www.codecademy.com/courses/learn-python/lessons/functions/exercises/practice-makes-perfect?action=resume_content_item

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

Why does the else at the line 7 not work? According to the correction system it’s an invalid syntax but i’m not able to correct it. Please help me.

Try replacing the indents manually with four space characters per block level.

False is a boolean, "False' is a string. We do not write boolean literals in quotes.

By manually inserting our indents we are able to promote consistency throughout…

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

Now the question that comes up is what gets returned in the if branch? At present it will be None. Consider returning the function call.

return cube(number)

The return value from cube() will be returned,

The problem is not with the Return function just make it return nothing or just hello, the line 7 will not work anyway.

I’m no Python expert, but have experience in several other languages. In Python indentation matters - a lot! Since your else isn’t indented the same as your if, it isn’t recognized as part of your if block. It’s a token unexpected else. Try following the format suggested by mtf earlier.