6. Practice Makes Perfect


#1

Hello guys,
I'm receiving this error:

File "python", line 4
if:
^
IndentationError: expected an indented block

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

I'm a beginner and have no idea of what is wrong with my code. Any help?
Thank you!


#2

HI your if statement should be like that

if (number) % 3 == 0 :

And the error that you got is IndentationError: expected an indented block so Its should be like that.

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

#3

Solved. Thank you :slightly_smiling: