摘要: #collections 模块#Counter 计数器,生成一个类字典类型from collections import Counterstr="abcbcaccbbad"#统计数量dcamd=Counter(str)print(dcamd)''' 打印:Counter({'b': 4, 'c': 阅读全文
posted @ 2021-02-20 10:14 HunterSniper 阅读(61) 评论(0) 推荐(0) 编辑
摘要: #################无序集合set_one=set(['a','b','c'])set_two=set(['b','c','d'])print (set_one)################# update 合并两个集合并去重,无返回值#t=set_one.update(set_t 阅读全文
posted @ 2019-08-02 08:09 HunterSniper 阅读(214) 评论(0) 推荐(0) 编辑
摘要: dict_one = {'a':'aa','b':'bb'}print(dict_one)################# clear 清空字典#dict_one.clear()#print(dict_one)################# copy 复制字典#复制dict_one,并更改di 阅读全文
posted @ 2019-07-30 21:36 HunterSniper 阅读(146) 评论(0) 推荐(0) 编辑