mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-07 09:58:03 +00:00
Fix #13, PEP8-ify notebooks.
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
"source": [
|
||||
"## Constraints\n",
|
||||
"\n",
|
||||
|
||||
"* Is a single character or number a palindrome?\n",
|
||||
" * No\n",
|
||||
"* Can we assume we already have a linked list class that can be used for this problem?\n",
|
||||
@@ -92,7 +91,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"class MyLinkedList(LinkedList):\n",
|
||||
" \n",
|
||||
"\n",
|
||||
" def is_palindrome(self):\n",
|
||||
" # TODO: Implement me\n",
|
||||
" pass"
|
||||
@@ -127,7 +126,7 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"class TestPalindrome(object):\n",
|
||||
" \n",
|
||||
"\n",
|
||||
" def test_palindrome(self):\n",
|
||||
" print('Test: Empty list')\n",
|
||||
" linked_list = MyLinkedList()\n",
|
||||
@@ -158,13 +157,15 @@
|
||||
" linked_list.append(2)\n",
|
||||
" linked_list.append(1)\n",
|
||||
" assert_equal(linked_list.is_palindrome(), True)\n",
|
||||
" \n",
|
||||
"\n",
|
||||
" print('Success: test_palindrome')\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"def main():\n",
|
||||
" test = TestPalindrome()\n",
|
||||
" test.test_palindrome()\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"if __name__ == '__main__':\n",
|
||||
" main()"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user