Python Recursively Iterate Through String