from collections import Counter

find = [1, 4]
cards = [1, 2, 1, 3, 2]
answer = [0, 0]

counter = Counter(cards)

for i in range(0, len(find)):
    if find[i] in counter:
        answer[i] += counter[find[i]]

print(answer)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: