Difflib Module
TL;DR
The difflib module provides tools for comparing sequences (especially text strings) and generating difference reports in various formats. It can find the similarity between strings, produce unified
or context diffs
like Unix diff tools, and identify close matches from a list of possibilities.