Returns the elements of B that are not in A.
(b, a)
| 8 | |
| 9 | |
| 10 | def difference (b, a): |
| 11 | """ Returns the elements of B that are not in A. |
| 12 | """ |
| 13 | assert is_iterable(b) |
| 14 | assert is_iterable(a) |
| 15 | result = [] |
| 16 | for element in b: |
| 17 | if not element in a: |
| 18 | result.append (element) |
| 19 | |
| 20 | return result |
| 21 | |
| 22 | def intersection (set1, set2): |
| 23 | """ Removes from set1 any items which don't appear in set2 and returns the result. |
nothing calls this directly
no test coverage detected