摘要: import requestsfrom pyquery import PyQuery as pqurl = 'https://www.zhihu.com/explore'headers = { 'user-agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x 阅读全文
posted @ 2018-08-10 21:15 BruceLong 阅读(1943) 评论(0) 推荐(0) 编辑
摘要: 题目:有一个字典对象,d = {'a':1,'b':2},请用尽量简洁的代码将d转换成{1: 'a', 2: 'b'} 第一种方法: 结果 第二种方法: dict(zip(d.values(), d.keys())) 结果 阅读全文
posted @ 2018-08-10 13:03 BruceLong 阅读(1286) 评论(0) 推荐(0) 编辑