Split String Based On Character Python Interview