Practice makes Perfect


#1

Please help

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

Oops, try again. by_three(1) returned 1 instead of False


#2

Switch these two lines around.

if number % 3: 
    return False
else:
    return cube(number)

#3

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