Skip to content

[New Concept Exercise] : sets #2296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BethanyG opened this issue Apr 3, 2020 · 1 comment · Fixed by #2485
Closed

[New Concept Exercise] : sets #2296

BethanyG opened this issue Apr 3, 2020 · 1 comment · Fixed by #2485
Assignees
Labels
new exercise ✨ x:size/large Large amount of work x:status/claimed Someone is working on this issue

Comments

@BethanyG
Copy link
Member

BethanyG commented Apr 3, 2020

This issue describes how to implement the sets concept exercise for the Python track.
This will be closed by #2485

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:

Please also watch the following video:

Goal

The goal of this exercise is to teach the basics of the set (set type) in Python.

Learning objectives

  • understand that a set is an unordered collection of distinct hashable objects
  • create a set via constructor (set()) and literal ({})
  • de-dupe a list of elements by converting a sequence type such as a list to a set type
  • check for a membership of an element in a given set via in
  • set comparison functions and set comparison operators (=<, >=, issubset(), issuperset(), etc.)
  • additional set operators (union, intersection, difference, and symmetric_difference)
  • add values to a given set via add()
  • remove values from a given set via discard()
  • iterate through a given set by using for item in set

Out of scope

  • frozenset()
  • clear() to delete all elements of a set
  • check the length of a given set via len()
  • remove as opposed to discard (remove tosses a keyerror if the element is not present)
  • all forms/variants of update()
  • remove (and use) a value from a given set via pop()
  • make shallow copy(s) of a given set via copy()
  • using additional builtins such as sorted(), min(), or map() with a set
  • set comprehensions

Concepts

  • sets
  • hashable objects
  • set comparisons
  • set operations

Prerequisites

  • basics
  • booleans
  • comparisons
  • dicts
  • lists
  • loops

Resources to refer to

Hints

Hints should link to the Sets section of the Python docs tutorial: Sets

After

After, the student can explore comprehension syntax, although it will be taught in separate exercises. This would also be a good time to explore set comparisons via function &/or operator, or experimenting with the issuperset() & issubset() functions.

Representer

No changes required.

Analyzer

No changes required.

Implementing

Tests should be written using unittest.TestCase, and the test file named dicts_basic_test.py.

Help

If you have any questions while implementing the exercise, please post the questions as comments in this issue.

Edits

@yawpitch yawpitch changed the title [Python] Implement new Concept Exercise: sets-basic [Python] Implement new Concept Exercise: sets Apr 23, 2020
@BethanyG BethanyG self-assigned this May 15, 2020
@BethanyG BethanyG changed the title [Python] Implement new Concept Exercise: sets [V3] Implement new Concept Exercise: sets Jan 28, 2021
@BethanyG BethanyG transferred this issue from exercism/v3 Jan 28, 2021
@BethanyG BethanyG added this to the First 22 Concept Exercises Due for V3 milestone Jan 29, 2021
@github-actions
Copy link
Contributor

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.

@BethanyG BethanyG modified the milestones: First 22 Concept Exercises Due for V3, New V3 Concept Exercises Mar 31, 2021
@BethanyG BethanyG modified the milestones: New V3 Concept Exercises, V3 Concept Exercises for Beta May 21, 2021
@BethanyG BethanyG changed the title [V3] Implement new Concept Exercise: sets [New Concept Exercise] : sets Jun 16, 2021
@BethanyG BethanyG added x:module/concept-exercise Work on Concept Exercises x:status/claimed Someone is working on this issue x:size/large Large amount of work claimed 🐾 For new exercises being written by contributors and maintainers. new exercise ✨ and removed x:module/concept-exercise Work on Concept Exercises labels Jun 16, 2021
@BethanyG BethanyG mentioned this issue Aug 21, 2021
12 tasks
@BethanyG BethanyG removed the claimed 🐾 For new exercises being written by contributors and maintainers. label Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new exercise ✨ x:size/large Large amount of work x:status/claimed Someone is working on this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant