Last active
December 14, 2016 18:53
-
-
Save nhuntwalker/44d1c5cf4c619e8f618ca3f6c6003f3a to your computer and use it in GitHub Desktop.
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
Write a function that takes two arguments that are strings | |
and returns whether or not one is a rotation of the other | |
word1 = tugboat | |
word2 = | |
ttugboa | |
attugbo | |
oattugb | |
boattug | |
returns True | |
ugttoab | |
returns False | |
TEST_TABLE = [ | |
["tugboat", "boattug", True], | |
["apple", "pear", False] | |
] | |
@pytest.mark.parametrize("one, two, truefalse", TEST_TABLE) | |
def test_rotations(one, two, truefalse) ...etc | |
----*------ OR -----*------- | |
if __name__ == "__main__": | |
print(rotations("tugboat", "boattug")) | |
rotations(tugboat, ttugboa) | |
email: nicholas@codefellows.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment