laithabad / HW2

Homework 2 for cs196fa16

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HW2

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.

Testing

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! "

Documentation

Here is all the documentation that you will need to finish this homework:

Helper Functions

http://programmers.stackexchange.com/questions/247267/what-is-a-helper-is-it-a-design-pattern-is-it-an-algorithm

Numbers / Types

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

Strings

https://docs.python.org/2/library/string.html
http://www.learnpython.org/en/Basic_String_Operations
https://learnpythonthehardway.org/book/ex6.html

Conditionals

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

Loops

https://wiki.python.org/moin/ForLoop
https://learnpythonthehardway.org/book/ex33.html
http://www.tutorialspoint.com/python/python_loops.htm

Help and Bugs

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!

About

Homework 2 for cs196fa16

License:MIT License


Languages

Language:Python 100.0%