Re: [Tutor] Please help to debug this function..

2006-11-07 Thread ALAN GAULD
Reposting to the list. --- Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > > >except ValueError: > > >flag = False > > >startdate = None > > >enddate = None > > >err_msg = traceback.format_exc() > > >index =

Re: [Tutor] Please help to debug this function.. it takes a date and num. of days and returns startdate and enddate (fwd)

2006-11-06 Thread Danny Yoo
[Forwarding to Tutor; busy at the moment] -- Forwarded message -- Date: Mon, 6 Nov 2006 18:41:54 + From: Asrarahmed Kadri <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] Please help to debug this function.. it takes a date and num.

Re: [Tutor] Please help to debug this function.. it takes a date andnum. of days and returns startdate and enddate

2006-11-06 Thread Alan Gauld
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote > Please test it, comment on the logic . I haven't tested it but here are some comments: > import string > import datetime > import traceback > > def dateCheck(date1,num_days): >flag = True >startdate = None >enddate = None > >if num_

Re: [Tutor] Please help to debug this function.. it takes a date and num. of days and returns startdate and enddate

2006-11-06 Thread Danny Yoo
On Mon, 6 Nov 2006, Asrarahmed Kadri wrote: > I have written a function that takes a date and an integer representing > the number of days. > > Please test it, comment on the logic . Hi Asrarahmed, You should be able to write your own tests too. You might want to look at: http://www.

[Tutor] Please help to debug this function.. it takes a date and num. of days and returns startdate and enddate

2006-11-06 Thread Asrarahmed Kadri
Hi Folks,   I have written a function that takes a date and an integer representing the number of days.   Please test it, comment on the logic .   Here is the code:   """ The function takes two arguments, date and  number of days. It checks for the right format and if the format is okay, it calc