What's wrong with my code. could someone pls help me


#1


python - functions - 6/19 practice makes perfect

Oops, try again. Your code looks a bit off. Check the console window for errors!


def cube(number):
    result = number**3
    return result

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


#2

You use improper indentation. Your by_three() function should look like this:

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

#3

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