String Reversal In Python Using Global Variables