Skip to content

性能优化 ​

python
import timeit

# 列表推导式比循环快
timeit.timeit('[x*2 for x in range(1000)]')

练习:答案

用心记录每一步成长