timeit
https://baijiahao.baidu.com/s?id=1671664364219061186&wfr=spider&for=pc
>>> timeit.timeit(stmt='10**4 in s',setup='s=range(10**5)', number=10**5)
0.006006000000070344
>>> timeit.timeit(stmt='10**4 in s',setup='s=set(range(10**5))', number=10**5)
0.0032372999999097374
本文来自博客园,作者:chuangzhou,转载请注明原文链接:https://www.cnblogs.com/czzz/p/17837551.html