-
Notifications
You must be signed in to change notification settings - Fork 20
Exercise Programming
- Make sure you've already done the Hello World Exercise
- Make sure you've read through the Control Flow and Data Structures pages.
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
IMPORTANT Each time you finish one problem, make sure to snapshot your work! Run these commands, where you replace XXX
with your problem number.
git commit -am "finished problem XXX"
git push origin master
Go to main pull requests page and find your pull request. If you have been following our git directions correctly, your pull request should be updated to include all your solutions to the the problems.
When you are done, leave a comment "DONE!!!!!!" to let us know that you're finished! We will use this pull request to provide feedback on your code.