for循环添加列表和列表推导式添加新列表对比
# -*- coding =utf-8 -*-# @Time : 2020/12/8 16:34# @Author :Mr# @File :实例1.py# @Software :PyCharmimport time# for循环新建一个列表,并把列表打印出来start = time.time()List = []for i in range(100001): if i not in List: List.append(i)print(List)end = tim