if a in list_test: return list_test.index(a) if a[0] in list_test: return list_test.index(a[0]) return -1 为啥要循环呢?
ipwx
2016-12-27 17:01:36 +08:00
我是来搞笑的:
findpos = (lambda items, s1, s2: (lambda f: ([i for (l, i) in sorted((x for x in (f(i, v) for (i, v) in enumerate(items)) if x))] + [-1])[0])(lambda i, v: (0, i) if v == s1 else ((1, i) if v == s2 else None)))