How to compare a list of lists/sets in python?

后端 未结 8 1797
情深已故
情深已故 2020-12-01 03:47

What is the easiest way to compare the 2 lists/sets and output the differences? Are there any built in functions that will help me compare nested lists/sets?

Inputs:

8条回答
  •  悲哀的现实
    2020-12-01 04:19

    http://docs.python.org/library/difflib.html is a good starting place for what you are looking for.

    If you apply it recursively to the deltas, you should be able to handle nested data structures. But it will take some work.

提交回复
热议问题