Last active
August 29, 2015 14:26
-
-
Save antonagestam/a65502b971d46a8a2697 to your computer and use it in GitHub Desktop.
compare two strings word by word
This file contains 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
""" | |
>>> comp("""Hi folks | |
... What is the best way to clear a Riak bucket of all key, values after | |
... running a test? | |
... I am currently using the Java HTTP API. | |
... """, """Hi folks | |
... | |
... What is the best way to clear a Riak bucket of all key, values after | |
... running a test? | |
... I am currently using the Java HTTP API. | |
... """) | |
AssertionError: 'folks\nWhat' != 'folks\n\nWhat' | |
""" | |
def comp(a, b): | |
to_list = lambda x: x.split(' ') | |
a, b = to_list(a), to_list(b) | |
for a, b in zip(a, b): | |
self.assertEqual(a, b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment