Homework 2

Functioning Recursively

Due: 11:59pm on Monday, February 5, 2018

Submission: submit your solutions at the submissions server

Problems:

(hw2pr0.py)(hw2pr1.py) (hw2pr2.py) Optional extra-credit problems/extensions are available here.(hw2pr3.py) (hw2pr4.py along with screenshots)

Docstrings and Comments

Every function that you write must have a docstring. The docstring should explain how many arguments the function takes, what these arguments are supposed to be, and what the function returns. The doctring is intented for the user of your function. In contrast, comments in your code are used to explain details that are important to a programmer who might be reading your code (that "programmer" could be you—it's easy to forget what you had in mind when you wrote your code!). Any function that is doing anything even modestly complex or non-obvious deserves some explanatory comments. We'll look for your docstrings and comments, so be sure to include them.

Submission

You should submit your files to the submission site whenever you've made progress and are ready to stop working on it for a while. If you do this, you will be able to obtain your latest submission from any web browser and work on it from any computer that has Python. You can always resubmit; we will only grade your latest submission. All of your earlier submissions, however, are stored in case you'd like to refer to them.

Lab Work

If you attended Lab 2 and have submitted your work, you will receive full credit for that problem.

A Note on Using Recursion

This assignment exercises the facility to write functions recursively. If you have some programming experience, you may be familiar with other, non-recursive strategies for solving these problems. Even if you do know such non-recursive strategies, however, we ask that you use recursion to solve the problems on this assignment. After all, our primary goal here is to practice an important problem-solving concept and technique, not simply to solve these particular problems!