Stuch at Practice Makes Perfect


#1

Hi there!
I'm stuck! I used the following code

def cube(number):
"""Returns the cube of number"""
return "number*number*number"

def by_three(number):
if number % 3 == 0:
return "cube(number)"
else:
return False
cube(3)

And there is an error message saying "cube(1) returned 'number*number*number' instead of 1"
Any help please?


#2

Hello, @blogninja64950!
In this exercise you should return a numeric value, not a literal which you're doing.

return "2" #Returns the string "2"
return 2 #Returns the value 2

You'll just need to fix that on your code.

Best regards,

g4be


#3

Hi
Thank you so much, that was indeed the problem! :slightly_smiling:


#4

No problem!

Quote or send me a message if there's anything else I can help you with!

Best regards,

g4be