Practice makes perfect. i'm stuck


#1

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

`python

def cube(number):
return number ** 3

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


#2

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


#3

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


#4

in python the Boolean value False has an uppercase first letter


#5

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


#6

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


#7

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