python icon indicating copy to clipboard operation
python copied to clipboard

[New Concept Exercise] : sequences and common sequence operations

Open DavidGerva opened this issue 5 years ago • 2 comments

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

  • slicing
  • indexing

Prerequisites

  • basics
  • iteration
  • lists
  • list-methods
  • sets
  • strings
  • tuples

Resources to refer to

  • https://railsware.com/blog/python-for-machine-learning-indexing-and-slicing-for-lists-tuples-strings-and-other-sequential-types/

Hints

  • TBD?

After

  • the slice() function

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.

DavidGerva avatar May 03 '20 14:05 DavidGerva

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 20 '21 01:02 github-actions[bot]

This issue has been automatically marked as abandoned 🏚 because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Sep 10 '22 02:09 github-actions[bot]

Flagging as close and reopen with new issue template.

BethanyG avatar Sep 13 '22 14:09 BethanyG