Fix #13, PEP8-ify notebooks.

This commit is contained in:
Donne Martin
2015-07-11 15:34:14 -04:00
parent 27c4a4f97c
commit 374d67ff30
18 changed files with 117 additions and 80 deletions

View File

@@ -34,7 +34,6 @@
"source": [
"## Constraints\n",
"\n",
"* Can you assume the string is ASCII?\n",
" * Yes\n",
" * Note: Unicode strings could require special handling depending on your language\n",
@@ -91,9 +90,10 @@
},
"outputs": [],
"source": [
"def is_substring(s1, s2): \n",
"def is_substring(s1, s2):\n",
" return s1 in s2\n",
"\n",
"\n",
"def is_rotation(s1, s2):\n",
" if s1 is None or s2 is None:\n",
" return False\n",
@@ -131,7 +131,7 @@
"\n",
"\n",
"class TestRotation(object):\n",
" \n",
"\n",
" def test_rotation(self):\n",
" assert_equal(is_rotation('o', 'oo'), False)\n",
" assert_equal(is_rotation(None, 'foo'), False)\n",
@@ -140,10 +140,12 @@
" assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)\n",
" print('Success: test_rotation')\n",
"\n",
"\n",
"def main():\n",
" test = TestRotation()\n",
" test.test_rotation()\n",
"\n",
"\n",
"if __name__ == '__main__':\n",
" main()"
]