Hey guys
so here's the problem
I have 2 lists:
how do i also count the multiple matches, giving me 3?
(the real question is with letters but the numbers are to simplify things)
thank you!
so here's the problem
I have 2 lists:
numbers = [1,2,3,4,5,6,7,8,9] given = [1,1,2]how do i find the amount of elements in the given-list that match the numbers-list?
len(set(numbers) & set(given))
gives me 2, because it doesn't count the multiple oneshow do i also count the multiple matches, giving me 3?
(the real question is with letters but the numbers are to simplify things)
thank you!