Reversing Strings In Python Using Global Variables