Skip to content

Exercise Programming

Kenny Yu edited this page Nov 4, 2013 · 4 revisions

Prereqs

Programming!

Go into the exercises-more directory. You should see exercises.py and tests.py.

Open up exercises.py. You should see problems and several functions that return dummy values right now.

To run all the tests:

python tests.py

You should see a whole bunch of failures.

To run a specific test, run this command:

python -m unittest tests.TestNumWords

where you can replace TestNumWords with anything that has the class keyword before it in tests.py (e.g. TestNumWords, TestSumList, TestAppears, etc.). These will run tests for the corresponding function in exercises.py.

Your goal is to finish all the functions in exercises.py and to make all these tests pass. Once all the tests pass, you should see this output when you run python tests.py:

.............................
----------------------------------------------------------------------
Ran 29 tests in 0.002s

OK

Finish Bootcamp

Go back home

Clone this wiki locally