Re: [Tutor] assert() question

2008-07-06 Thread Dick Moores
At 02:30 PM 7/6/2008, Kent Johnson wrote: On Sun, Jul 6, 2008 at 2:49 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > I have a module, mycalc.py, which is a collection of functions designed to > be imported independently. > > I've heard about using assert() to check up on whether things are still >

Re: [Tutor] assert() question

2008-07-06 Thread Kent Johnson
On Sun, Jul 6, 2008 at 2:49 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > I have a module, mycalc.py, which is a collection of functions designed to > be imported independently. > > I've heard about using assert() to check up on whether things are still > working correctly, or something like that. S

Re: [Tutor] assert() question

2008-07-06 Thread Dick Moores
At 06:01 AM 7/6/2008, Alan Gauld wrote: "Dick Moores" <[EMAIL PROTECTED]> wrote Traceback (most recent call last): File "E:\PythonWork\Untitled 2.py", line 42, in assert(fact(10,4) == 3.629e+6) AssertionError I'm not sure but I suspect you are running into the dreaded floating point pre

Re: [Tutor] assert() question

2008-07-06 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote Traceback (most recent call last): File "E:\PythonWork\Untitled 2.py", line 42, in assert(fact(10,4) == 3.629e+6) AssertionError I'm not sure but I suspect you are running into the dreaded floating point precision problem. You probably need to

Re: [Tutor] assert() question

2008-07-06 Thread Dick Moores
At 01:23 AM 7/6/2008, Alan Gauld wrote: "Dick Moores" <[EMAIL PROTECTED]> wrote I've heard about using assert() to check up The top three work silently, but I found that I could not figure out how to use assert() with the functions that print rather than return. E.g., maxDiffBetPrimes() and prin

Re: [Tutor] assert() question

2008-07-06 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote I've heard about using assert() to check up The top three work silently, but I found that I could not figure out how to use assert() with the functions that print rather than return. E.g., maxDiffBetPrimes() and printTime(). Is there a way? Thats an

[Tutor] assert() question

2008-07-05 Thread Dick Moores
I have a module, mycalc.py, which is a collection of functions designed to be imported independently. I've heard about using assert() to check up on whether things are still working correctly, or something like that. So I've begun to write some assert() expressions(?)  and put them at the bottom