Krzysztof Szynter wrote: > def maxvalue(TY): #gets an index of the max value in the TY list > max = 0 > for i in range(0,len(TY)): > if (max<TY[i]): > max = i > print TY[i],max > continue > return max max is an index, right? So your test should be if TY[max] < TY[i]: [....] In your code, you compare the index to a value. Greetings, Holger