Loop and the list

rzed rzantow at ntelos.net
Fri May 14 10:10:37 EDT 2004


Krzysztof Szynter <dygimailNo at SPAMpoczta.fm> wrote in
news:Xns94E9A04898D48dygimailpocztafm at 127.0.0.1: 

[...]
> I don't understand why function maxvalue returns "9". When i
> start a program and check TY list in 'first main point', the max
> value has an index 0'. Then putting the list into the function
> maxvalue, gives me the index '9'. ;--/
> 
> Where is the mistake?
> 
> ps
> Apologise for the Polish text's, in the code. I'll answer for
> any question. 
> 

In maxvalue, you are comparing an index to a value, which seems 
unlikely to be what you want. Did you mean:
    	if (TY[max] < TY[i]):



-- 
rzed




More information about the Python-list mailing list