I want to take two lists and want to count the values that appear in both but considering the same position.
a = [1, 2, 3, 4, 5]
b = [4, 5, 3, 6, 5]
returnMatches(a, b)
would return 2
, for instance.
a = [1, 2, 3, 4, 5]
b = [1, 2, 3, 3, 5]
returnMatches(a, b)
would return 4
, for instance.
Is there a pythonic one line option or do I really need to iterate over both lists?
Thanks