mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-05 08:58:02 +00:00
Fix #13, PEP8-ify notebooks.
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
"source": [
|
||||
"## Constraints\n",
|
||||
"\n",
|
||||
|
||||
"* Do you expect the methods to be enqueue and dequeue?\n",
|
||||
" * Yes\n",
|
||||
"* Can we assume we already have a stack class that can be used for this problem?\n",
|
||||
@@ -92,7 +91,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"class QueueFromStacks(object):\n",
|
||||
" \n",
|
||||
"\n",
|
||||
" def __init__(self):\n",
|
||||
" # TODO: Implement me\n",
|
||||
" pass\n",
|
||||
@@ -131,7 +130,7 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"class TestQueueFromStacks(object):\n",
|
||||
" \n",
|
||||
"\n",
|
||||
" def test_queue_from_stacks(self):\n",
|
||||
" print('Test: Dequeue on empty stack')\n",
|
||||
" queue = QueueFromStacks()\n",
|
||||
@@ -141,7 +140,7 @@
|
||||
" print('Test: Enqueue on non-empty stack')\n",
|
||||
" print('Test: Multiple enqueue in a row')\n",
|
||||
" num_items = 3\n",
|
||||
" for i in range (0, num_items):\n",
|
||||
" for i in range(0, num_items):\n",
|
||||
" queue.enqueue(i)\n",
|
||||
"\n",
|
||||
" print('Test: Dequeue on non-empty stack')\n",
|
||||
@@ -158,10 +157,12 @@
|
||||
"\n",
|
||||
" print('Success: test_queue_from_stacks')\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"def main():\n",
|
||||
" test = TestQueueFromStacks()\n",
|
||||
" test.test_queue_from_stacks()\n",
|
||||
" \n",
|
||||
"\n",
|
||||
"\n",
|
||||
"if __name__ == '__main__':\n",
|
||||
" main()"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user