Skip to content

Instantly share code, notes, and snippets.

@afaqk9394
Created March 5, 2020 01:19
Show Gist options
  • Save afaqk9394/201e5ee11b932205b1f97ed2ac6f657a to your computer and use it in GitHub Desktop.
Save afaqk9394/201e5ee11b932205b1f97ed2ac6f657a to your computer and use it in GitHub Desktop.
import difflab
veggies1 = '''
celery
spinach
lettuce
garlic
carrot
cabbage
potato
tomato
'''.strip().splitlines()
veggies2 = '''
celery
spinach
onion
garlic
carrot
potato
cucumber
tomato
'''.strip().splitlines()
for veggie in difflib.unified_diff(veggies1, veggies2, fromfile='original', tofile='modified', lineterm=''):
print(veggie)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment