Jan-10-2019, 12:25 PM
This can be greatly simplified, example:
>>> list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] >>> list2 = [4, 8, 2, 0, 5] >>> # same number, wrong postiion ... [b for a, b in zip(list1, list2) if b != a] [4, 8, 2, 0] >>> # same number same position ... [b for a, b in zip(list1, list2) if b == a] [5] >>>