Fix #13, PEP8-ify notebooks.

This commit is contained in:
Donne Martin
2015-07-11 15:39:59 -04:00
parent 4566d1a803
commit 3712839cc9
26 changed files with 139 additions and 92 deletions

View File

@@ -34,7 +34,6 @@
"source": [
"## Constraints\n",
"\n",
"* None"
]
},
@@ -137,13 +136,14 @@
"source": [
"%%writefile stack.py\n",
"class Node(object):\n",
" \n",
"\n",
" def __init__(self, data):\n",
" self.data = data\n",
" self.next = None\n",
"\n",
"\n",
"class Stack(object):\n",
" \n",
"\n",
" def __init__(self, top=None):\n",
" self.top = top\n",
"\n",
@@ -208,7 +208,7 @@
"\n",
"\n",
"class TestStack(object):\n",
" \n",
"\n",
" # TODO: It would be better if we had unit tests for each\n",
" # method in addition to the following end-to-end test\n",
" def test_end_to_end(self):\n",
@@ -236,13 +236,15 @@
" assert_equal(stack.pop(), 1)\n",
" assert_equal(stack.peek(), None)\n",
" assert_equal(stack.is_empty(), True)\n",
" \n",
"\n",
" print('Success: test_end_to_end')\n",
"\n",
"\n",
"def main():\n",
" test = TestStack()\n",
" test.test_end_to_end()\n",
" \n",
"\n",
"\n",
"if __name__ == '__main__':\n",
" main()"
]