Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

How to compare two lists and return the number of times they match at each index in python

>>> list1 = [1,1,0,1,0,1]
>>> list2 = [0,1,0,1,1,0]
>>> sum(a == b for a,b in zip(list1, list2))
3
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #compare #lists #return #number #times #match #index #python
ADD COMMENT
Topic
Name
9+9 =