Transform String Into Array Python Definition Function