I dont get this!

Erik Max Francis max at alcyone.com
Thu Aug 23 19:40:41 EDT 2001


Peter Sundling wrote:

> Help! :)
> I have been programming in python for some time now, and today i
> found a strange bug in my code i cant get rid of...
> 
> Here is a code snippet where something is wrong somewhere:
> 
> def check_hilo(i):
>         if value[i] < low[i]:
>                 return 1
> 
>         if value[i] > high[i]:
>                 return 2
> 
>         return 0
> 
> ...Simple, huh? I have never had any trouble with something like this
> before.
> The thing is that this procedure always returns 1.
> I have tried to rewrite this little source code a couple of times,
> in many different ways, and it still returns 1!

The problem lies elsewhere.  You'll have to give us a more relevant
snippet of the actual code involved if you want help tracking it down.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Seriousness is the only refuge of the shallow.
\__/ Oscar Wilde
    Polly Wanna Cracka? / http://www.pollywannacracka.com/
 The Internet resource for interracial relationships.



More information about the Python-list mailing list