Overview:
- Given the differences found between two lists of strings which are generated using the using the difflib.ndiff() function or the compare() method of difflib.Differ() class, the restore() function recreates the input lists.
Example:
|
# Example Python program that creates import difflib # String lists # Find differences print("Differences:") # Get the first list of strings back # Get the second list of strings back |
Output:
|
Differences: |