Practice makes perfect


#1

when i run my code this appears
'' File "python", line 7
return cube(number)
^IndentationError: expected an indented block"
i dont whats is wrong with my code,can someone tell me ?

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

#2

You need to indent your return statements inside the if and else statements.


#3

ahh thank u very much!!


#4

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