Reversing String In Python Using Global Variables