Update snippet descriptions

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-11-02 19:27:53 +02:00
parent a2cd6db3b0
commit 0ab4b3dbc5
26 changed files with 64 additions and 62 deletions

View File

@ -3,9 +3,10 @@ title: difference
tags: list,beginner
---
Returns the difference between two iterables.
Calculates the difference between two iterables, without filtering duplicate values.
- Create a `set` from `b`, then use list comprehension on `a` to only keep values not contained in the previously created set, `_b`.
- Create a `set` from `b`.
- Use a list comprehension on `a` to only keep values not contained in the previously created set, `_b`.
```py
def difference(a, b):