Stuck at: Practice Makes Perfect (solved)


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

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


  File "python", line 12
    else:
        ^
IndentationError: unindent does not match any outer indentation level

what am I doing wrong?


#2

Indent your return statement.

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

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

#3

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