"Dick Moores" <[EMAIL PROTECTED]> wrote
Traceback (most recent call last): File "E:\PythonWork\Untitled 2.py", line 42, in <module> 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 try: result = 3.694e+6 e = result/1000000 # add zeros to suit! assert(result - e < fact(10,4) < result + e) Or somesuch Just a guess though. Alan G. _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
