Deadline: Sept 13, 2016, 7pm
Make sure you set up and push this homework to your homework repo, which you can build using these directions: https://github.com/CS196Illinois/Lecture-Notes/blob/master/creating_hw_repo.md
DO NOT CHANGE THE FILE NAMES.
This week, we provided a full test suite as a separate python file. The python file hw2_test.py will import all functions written in the hw2.py file and test them against a battery of test suites. These tests are not all inclusive (do not include all edge cases). To use the test suite, both of the files must be in the same directory, on the same level. Open up your terminal and type the command:
$ python hw2_test.py
If you pass, the terminal will print "All tests passed!" Otherwise, the terminal will spit out errors.
If you want to focus on one problem, you can comment out the line in main where the tests are run, like so:
def testAll():
#testPangram()
#testPrimeTest()
#testCountVowels()
#testMostCommonChar()
testFibonacci() # focus on testFibonacci
#testAdvancedDivision()
#testPalindrome()
#testUnique()
#testNthPalindromicPrime()
print "All tests passed! "
Here is all the documentation that you will need to finish this homework:
http://www.tutorialspoint.com/python/python_numbers.htm
https://docs.python.org/2.4/lib/typesnumeric.html
https://docs.python.org/2/library/stdtypes.html
https://docs.python.org/2/library/string.html
http://www.learnpython.org/en/Basic_String_Operations
https://learnpythonthehardway.org/book/ex6.html
https://en.wikibooks.org/wiki/Python_Programming/Conditional_Statements
http://www.python-course.eu/conditional_statements.php
http://www.openbookproject.net/books/bpp4awd/ch04.html
https://wiki.python.org/moin/ForLoop
https://learnpythonthehardway.org/book/ex33.html
http://www.tutorialspoint.com/python/python_loops.htm
If you find bugs in the homework, please post on Piazza or contact Ananya or myself (Austin). As always, feel free to post on slack and piazza for help, and to come to office hours if you get stuck.
This week's homework will be hard. Good luck!