Logo

Programming-Idioms

History of Idiom 218 > diff from v5 to v6

Edit summary for version 6 by Oldboy:
New Python implementation by user [Oldboy]

Version 5

2020-01-10, 23:13:14

Version 6

2020-01-11, 07:43:03

Idiom #218 List intersection

Create list c containing all unique elements that are contained in both lists a and b.
c should not contain any duplicates, even if a and b do.
The order of c doesn't matter.

Idiom #218 List intersection

Create list c containing all unique elements that are contained in both lists a and b.
c should not contain any duplicates, even if a and b do.
The order of c doesn't matter.

Extra Keywords
intersect and conjunction
Extra Keywords
intersect and conjunction
Code
c = list(set(a) & set(b))