What's the fastest way to compare two large lists of 1's & 0's and return the difference count/percentage?
问题 I'm in need of a method to quickly return the number of differences between two large lists. The contents of each list item is either 1 or 0 (single integers), and the amount of items in each list will always be 307200. This is a sample of my current code: list1 = <list1> # should be a list of integers containing 1's or 0's list2 = <list2> # same rule as above, in a slightly different order diffCount = 0 for index, item in enumerate(list1): if item != list2[index]: diffCount += 1 percent =