def count_common(l1, l2):
    l2_copy = list(l2)
counter = 0
for i in l1:
    if i in l2_copy:
        counter += 1
l2_copy.remove(i)
return counter
l1 = [1, 1, 1]
l2 = [1, 2]
print(count_common(l1, l2))
Common elements between two lists not using sets in Python