标签: python python-3.x
反向迭代list1以查找低于list2中最大可能数的第一个元素,但是即使list2的值 lst1 = [2, 4] lst2 = [3, 5, 7, 8, 9, 10, 12, 13] val = None for i in lst1[::-1]: if i < lst2[-1]: val = i index = val
lst1 = [2, 4] lst2 = [3, 5, 7, 8, 9, 10, 12, 13] val = None for i in lst1[::-1]: if i < lst2[-1]: val = i index = val