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

@@ -3,12 +3,13 @@ from nose.tools import assert_equal
class TestUniqueChars(object):
def test_unique_chars(self, func):
def test_unique_chars(self, func):
assert_equal(func(''), True)
assert_equal(func('foo'), False)
assert_equal(func('bar'), True)
print('Success: test_unique_chars')
def main():
test = TestUniqueChars()
test.test_unique_chars(unique_chars)
@@ -19,6 +20,7 @@ def main():
# Alternate solutions are only defined
# in the solutions file
pass
if __name__ == '__main__':
main()

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",
@@ -112,12 +111,13 @@
"\n",
"class TestUniqueChars(object):\n",
"\n",
" def test_unique_chars(self, func):\n",
" def test_unique_chars(self, func):\n",
" assert_equal(func(''), True)\n",
" assert_equal(func('foo'), False)\n",
" assert_equal(func('bar'), True)\n",
" print('Success: test_unique_chars')\n",
"\n",
"\n",
"def main():\n",
" test = TestUniqueChars()\n",
" test.test_unique_chars(unique_chars)\n",
@@ -128,7 +128,8 @@
" # Alternate solutions are only defined\n",
" # in the solutions file\n",
" pass\n",
" \n",
"\n",
"\n",
"if __name__ == '__main__':\n",
" main()"
]

View File

@@ -213,12 +213,13 @@
"\n",
"class TestUniqueChars(object):\n",
"\n",
" def test_unique_chars(self, func):\n",
" def test_unique_chars(self, func):\n",
" assert_equal(func(''), True)\n",
" assert_equal(func('foo'), False)\n",
" assert_equal(func('bar'), True)\n",
" print('Success: test_unique_chars')\n",
"\n",
"\n",
"def main():\n",
" test = TestUniqueChars()\n",
" test.test_unique_chars(unique_chars)\n",
@@ -229,7 +230,8 @@
" # Alternate solutions are only defined\n",
" # in the solutions file\n",
" pass\n",
" \n",
"\n",
"\n",
"if __name__ == '__main__':\n",
" main()"
]
@@ -258,21 +260,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 2",
"language": "python",
"name": "python3"
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.3"
"pygments_lexer": "ipython2",
"version": "2.7.10"
}
},
"nbformat": 4,