You overwrote the input, number here. So if user enters any number other than 3, it will return 27 regardless.
EDIT: I see your confusion. Your first function should only cube whatever the input number is. Like if number is 1, then your cube function should return 1. If number is 2, your cube function should return 2**3 which is 8. This function is a "helper" and is a part of the main function, by_three.
As for your second function (by_three), it checks whether the same input, number is divisible by 3. If it is, it calls upon the cube helper function you wrote before. Or returns False otherwise.
For Codecademy's tests, they basically just call your by_three function to see if everything is correct as it also happens to include your cube function with it.