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


#1


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


#2

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

return cube(number);

#3

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".


#4

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.


#5

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