Practice makes perfect


#1

Hello everyone,

How can you tell if your code it is really not "off". Mine is letting me move forward, but the request says "by_three should call cube(number) and return its result." Mine doesn't return the result, just says "None" , so I don't really know if I'm correct. Anyone can provide a clue?


Practice makes perfect
#2

can we see your code? The exercise sometimes just want you to built a function, if you really want output, you need to call the function


#3

Sure!:
def cube(number):
"""returns the cube value"""
cube = number**3
return cube
def by_three(number):
if number % 3 == 0:
return cube(number)
print "%s is divisible by 3" % (number)
else:
return False

Hope my code does not look so messy.
Thanks for the help by the way!


#4

like i said, you need to call your function in order to achieve what you want


#5

Understood.

Thanks @stetim94 . I'll try that and see what happen :slight_smile:


#6

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