mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-13 21:08:06 +00:00
Fix #13, PEP8-ify notebooks.
This commit is contained in:
@@ -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()"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user