Note: this issue was ported from the working [V3] repo, and needs to be re-done.
This issue describes how to implement the slicing concept exercise for the Python track.
Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
Goal
The goal of this exercise is to teach the student about the slicing operation in Python and how it applies to various data types.
Learning objectives
- what is a slice (a copy of a selected subsection).
- understand slice syntax (e.g.
[start : stop : step]), and how Python evaluates slices.
- understand indexing from the left and the right, and how this applies to slicing.
- understand which built-in data types & data structures can be sliced, and which cannot. (strings can, numbers cannot).
- perform slice operations on strings.
- perform a slice operations on sequence types (
lists, sets, & tuples).
- copy an object via the "full" slice
[:]
- reverse an object order via the "reverse slice"
[::-1]
Out of scope
- slice assignment
slice() function, and how it differs from [ ] notation
slice objects
itertools.islice()
Concepts
Prerequisites
basics
iteration
lists
list-methods
sets
strings
tuples
Resources to refer to
Hints
After
Representer
No changes required.
Analyzer
No changes required.
Implementing
Tests should be written using unittest.TestCase and the test file named slicing_test.py.
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.
Note: this issue was ported from the working [V3] repo, and needs to be re-done.
This issue describes how to implement the
slicingconcept exercise for the Python track.Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
Goal
The goal of this exercise is to teach the student about the
slicingoperation in Python and how it applies to various data types.Learning objectives
[start : stop : step]), and how Python evaluates slices.lists,sets, &tuples).[:][::-1]Out of scope
slice()function, and how it differs from[ ]notationsliceobjectsitertools.islice()Concepts
Prerequisites
basicsiterationlistslist-methodssetsstringstuplesResources to refer to
Hints
After
slice()functionRepresenter
No changes required.
Analyzer
No changes required.
Implementing
Tests should be written using unittest.TestCase and the test file named slicing_test.py.
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.