Could someone please check this for me


functions 6.practice makes perfect--- python

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 : 
    return false


First function looks good.
But how come you completely ditch the concept of indenting anything in the function for the second one?
You also seem to be ditching the fact that you need a : at the end of your def line in the second one while your first one has it:

def cube(number):
def by_three(number)

See the difference?


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