上一页 1 ··· 331 332 333 334 335 336 337 338 339 ··· 367 下一页
摘要: 1、 >>> test1 = dict(key1="aaa",key2="bbb",key3="ccc",key4="ddd") >>> test1 {'key1': 'aaa', 'key2': 'bbb', 'key3': 'ccc', 'key4': 'ddd'} >>> del test1[ 阅读全文
posted @ 2021-01-01 20:14 小鲨鱼2018 阅读(4117) 评论(0) 推荐(0) 编辑
摘要: 1、 >>> a = dict(zip(["one","two","three"],[100,200,300])) >>> a {'one': 100, 'two': 200, 'three': 300} >>> b = a >>> b {'one': 100, 'two': 200, 'three 阅读全文
posted @ 2021-01-01 19:47 小鲨鱼2018 阅读(371) 评论(0) 推荐(0) 编辑
摘要: >>> test1 = ["aaa","bbb","ccc","ddd"] >>> test2 = [111,222,333,444] >>> test3 = {} >>> for i in zip(test1,test2): test3[i[0]]=i[1] >>> test3 {'aaa': 1 阅读全文
posted @ 2021-01-01 19:07 小鲨鱼2018 阅读(1106) 评论(0) 推荐(0) 编辑
摘要: >>> test1 = [100,300,500,1000] >>> test2 = [350,550,300,350] >>> for i in zip(test1,test2): i[0] + i[1] 450 850 800 1350 阅读全文
posted @ 2021-01-01 19:03 小鲨鱼2018 阅读(382) 评论(0) 推荐(0) 编辑
摘要: >>> test1 = dict(key1="xx",key2="yy",key3="aa",key4="bb",key5="cc",key6="dd") >>> type(test1) <class 'dict'> >>> len(test1) 6 >>> test2=["key3","key5" 阅读全文
posted @ 2021-01-01 18:35 小鲨鱼2018 阅读(7135) 评论(0) 推荐(0) 编辑
摘要: >>> test1 = dict(key8="ccc",key3="ete",key2="iii",key4 = "wwww") >>> type(test1) <class 'dict'> >>> len(test1) 4 >>> for i,j in test1.items(): print(i 阅读全文
posted @ 2021-01-01 18:00 小鲨鱼2018 阅读(659) 评论(0) 推荐(0) 编辑
摘要: 1、 >>> test1 = dict(key1="xxx",key2="aaa",key3=100,key="abc") >>> test1 {'key1': 'xxx', 'key2': 'aaa', 'key3': 100, 'key': 'abc'} >>> type(test1) <cla 阅读全文
posted @ 2021-01-01 17:50 小鲨鱼2018 阅读(236) 评论(0) 推荐(0) 编辑
摘要: >>> test1 = {"zhangsan":["java","c","python"],"lisi":["c++","golang"],"wangwu":["c","java","python","javascript"]} >>> type(test1) <class 'dict'> &g 阅读全文
posted @ 2021-01-01 12:28 小鲨鱼2018 阅读(1461) 评论(0) 推荐(0) 编辑
摘要: 1、 >>> test1 = ["aaa","bbb","aaa","aaa","ccc","ccc","ddd","eee"] >>> test2 = [] >>> for i in test1: if i not in test2: test2.append(i) >>> test2 ['aaa 阅读全文
posted @ 2020-12-31 23:17 小鲨鱼2018 阅读(108) 评论(0) 推荐(0) 编辑
摘要: >>> test1 = {"key8":"aaa","key4":"bbb","key9":"ccc","key3":"ddd","key2":"eee"} >>> for i in test1.keys(): print(i) key8 key4 key9 key3 key2 >>> for i 阅读全文
posted @ 2020-12-31 22:42 小鲨鱼2018 阅读(79) 评论(0) 推荐(0) 编辑
上一页 1 ··· 331 332 333 334 335 336 337 338 339 ··· 367 下一页