摘要: (1)推导式 I.列表推导式:list.append() urls = [] for i in range(1,5): url = 'page{}'.format(i) urls.append(url) print(urls) # ['page1', 'page2', 'page3', 'page4 阅读全文
posted @ 2021-12-07 16:58 鲲尘轻杳 阅读(36) 评论(0) 推荐(0) 编辑
摘要: (1)计算性能 import timeit # pip install ipython timeit.Timer(函数名).timeit(次数) timeit.timeit(字符串或函数名) (2)元组与列表 (3)字典与集合 # 集合 se = set() # 空集合 set1 = {1,2,3, 阅读全文
posted @ 2021-12-07 16:41 鲲尘轻杳 阅读(26) 评论(0) 推荐(0) 编辑