[Tutor] script comparing two values - ASCII encoding error
Alfred Milgrom
fredm@smartypantsco.com
Wed Feb 26 23:43:02 2003
Hi Mic:
I tried the code that you submitted, and when I typed it in it worked fine=
:)
However when I copied what you emailed, I got the same error as you did :(
I identified the problem as being in your string 'f(x, s) =AD j'
Specifically, although the minus sign in that expression looks like a minus=
=20
sign it is not a minus sign. It is not the same character as you used in=20
the line 'while max - min > delta'. (Perhaps you have two minus sign keys=20
on your keyboard or you pressed another key at the same time ? In any case=
=20
I cannot duplicate the wrong minus sign.)
You can check this out by copying out the function definition, and then=20
replacing the bad minus sign with the good minus sign from bisect, and you=
=20
will see everything works fine.
Fred
At 06:47 PM 26/02/03 -0800, Mic Forster wrote:
>Hi Jeff,
>
>What I sent you originally was all Python gave to me.
>There was no traceback given. I also tried all your
>suggestions below, including your personalised
>function, but still to no avail.
>
>Confused, Mic
>
>
>--- Jeff Shannon <jeff@ccvcorp.com> wrote:
> > Mic Forster wrote:
> >
> > >I repeated the code you recommended and had no
> > >problem. All of the sudden this started happening:
> > >
> >
> > I don't see offhand anything that should be causing
> > a UnicodeError.