Functions: Practice Makes Perfect


Hi I've been stumped with a syntax error that keeps on appearing with this lesson. My code ends up looking like this:

def cube(number):
    return number**3

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

When I run the function I keep on getting the following:
File "python", line 5
if: number % 3 == 0
SyntaxError: invalid syntax

I'm not sure what I'm doing incorrectly.

Thanks in advance


In the if statement colon should be placed after the condition:

if number % 3 == 0: