# HG changeset patch # User Madhusudan.C.S # Date 1283849988 -19800 # Node ID f65aec952da7ee9518b06934d4da1a03b6c39d94 # Parent b9c6563869effdf2e8201ee9e33195c0e18e320d Add second lab exercise questions. diff -r b9c6563869ef -r f65aec952da7 tdd/lab-workbook.rst --- a/tdd/lab-workbook.rst Tue Sep 07 12:09:06 2010 +0530 +++ b/tdd/lab-workbook.rst Tue Sep 07 14:29:48 2010 +0530 @@ -25,7 +25,18 @@ Lab - 2 ======= - 1. + 1. Write the stub function, followed by the tests(demonstrating the + failed tests), in turn followed by the code(demonstrating the + passing tests) to calculate the number of days between two + dates. Name your function num_of_days(). The function should take + two arguments, both being tuples. Each tuple represents the date + in the format of (dd, mm, yyyy) where dd, mm and yyyy are + integers. + 2. Rewrite the num_of_days() function to take the start date as an + optional argument. If the start date is not specified calculate + the number of days between the only specified date since Unix + epoch. Prior to manipulating the code to do this, make sure you + change the tests, make them fail and then refactor the code. Lab -3