Now your by_three function is inside your cube function. I think it shouldn't be, which exercise is this? (url would be nice), you can have two function like so:
print "do something"
print "do something else"
See the difference? You nested the functions, this are two functions after each other.
Please read this post about markdown so your code/indent will show.