I know that there are countless ways to ROT13 and that Python even has a in-built function, but I really want to understand how to modify the code that I've written. It works fine when I test it in my editor (maintains white space, punctuation and case) but won't work in my web page. I've been told that I'm just printing the characters out and not copying them into the result string. I've played with it for hours but haven't yet figured out how to manipulate it to incorporate a return statement.

Sorry if this is a silly question - I am a newbie :) Any help is super appreciated.

As you wrote yourself, you are printing the result out. Printing to standard out does not work in web applications, since they normally use a protocol (unix socket or the like) for communicating data back to the web server process (or you use a Python-based web server such as Twisted, in which case standard output will go to the console where you started the process).

So, again as you write, you need to modify the function in order to return the value instead of printing it. There are countless ways of doing this, the simplest being to just replace the standard output with a StringIO object: