Typescript Slice Array Python Practice