标签:tar array for span code target index targe pre
1 array = [[0,0],[1,20],[2,40],[3,80],[4,100]] 2 target = array[-1] 3 indexMin = 1 4 5 for row in array[0:-1]: 6 index = (target[0] - row[0]) / (target[1] - row[1]) 7 if(index < indexMin): 8 indexMin = index 9 result = row[1] 10 11 input(result)
标签:tar array for span code target index targe pre
原文地址:https://www.cnblogs.com/CaiNongSun/p/13125203.html