Created
March 5, 2020 01:20
-
-
Save afaqk9394/890bbb383a79da89c6431d6002e58a75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import difflib | |
veggies1 = ''' | |
celery | |
spinach | |
lettuce | |
garlic | |
carrot | |
cabbage | |
potato | |
tomato | |
'''.strip().splitlines() | |
veggies2 = ''' | |
celery | |
spinach | |
onion | |
garlic | |
carrot | |
potato | |
tomato | |
cucumber | |
'''.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