Inside a function, the return keyword tells the function, “I am done - return to the code/function you were executing before you started executing me.” This effectively terminates the function wherever the return statement is. Nothing else in the function will execute after that statement.
Additionally, the return statement can specify a value to pass back to the calling function. In the case with your code, the value being returned was whatever was stored in the result variable.
I can’t tell because of the lack of indentation in the forum post, but the issue is that you were trying to print result from outside the function or you were trying to print result inside the function but after the return statement, so that line would never run.
Instead, you need to print from within the function, prior to return. Or print the result returned from the function, which is what I suggested.
Hope that helps!