unique0 = list(lines[0].keys()) - list(lines[1].keys())
unique1 = list(lines[1].keys()) - list(lines[0].keys())
result = [lines[0][x] for x in unique0] + [lines[1][x] for x in unique1]
Quickly find differences between two large text files