Practice makes perfect. i'm stuck


i'm stuck, i don't know what to do anymore. it kept displaying the error below. Can anyone come to my rescue?
Oops, try again. by_three(1) returned 1 instead of False


def cube(number):
return number ** 3

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


if this condition is true:

if number % 3 == 0:

cube(number) should be returned, else false should be returned, you seem to have swapped it


when i swap that it displays "Oops, try again. by_three(1) resulted in an error: global name 'false' is not defined"


in python the Boolean value False has an uppercase first letter


omg, thank you so much. I'm grateful
so its F in lowercase that has been causing this trouble


yes, because false would be a variable, which is isn't defined (thus the undefined error message)


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