How to compare two list?

Do this:

image

with this, the result of “compare_lists(List1,List2)” would be ‘false’, while “compare_lists(List1,List3)” would return ‘true’.

The strength of this approach is that lists of different length are immediately reported as not being the same, and that the comparison of elements stops as soon as there is one mismatch. Only in the case of identical lists would all the elements be checked one against one.

3 Likes