Created
March 5, 2020 01:19
-
-
Save afaqk9394/5695d82e4946733928084190648ef6bf 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 | |
potato | |
carrot | |
cabbage | |
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