Python ProgrammingPython Programming

Print all items from List that differ from the item at the same index in another List

list1 = [5, 9, 4, 8, 7, 1]
list2 = [5, 6, 8, 9, 7, 1]

print(*[x for x, y in zip(list1, list2) if x != y], sep='\n')
Output
9
4
8