Reversing A String In Python Using Global Variables