I want to take two lists and find the values that appear in both.
a = [1, 2, 3, 4, 5] b = [9, 8, 7, 6, 5] returnMatches(a, b)
would return
You can use:
a = [1, 3, 4, 5, 9, 6, 7, 8] b = [1, 7, 0, 9] same_values = set(a) & set(b) print same_values
Output:
set([1, 7, 9])