Don't know what i am doing wrong practice makes perfect


practice makes perfect

oops try again by_three(1)resulted in error:global name false is not defined

Replace this line with your code. 
def cube(number):
 return number**3

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


Here we can use the utility function, cube(), as suggested in the exercise.

return cube(number);


What he said. ^^^

under def by_three(number):, it should be "return cube(number)" not "return **3".

And also, your call for "false" must be "False" with a capital "F" and not "f".


One mistake at a time, is how I approach things. It always leaves room for the learner to find others on their own. You are correct in pointing out the case on the boolean, but the lack of response on this topic reply would suggest that our cases are moot.


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