摘要: 字典内置函数 Python字典包含了以下内置函数: cmp(dict1, dict2)比较两个字典元素。 len(dict)计算字典元素个数,即键的总数。 str(dict)输出字典可打印的字符串表示。 type(variable)返回输入的变量类型,如果变量是字典就返回字典类型。 Python字典 阅读全文
posted @ 2019-07-14 23:35 oceansharks 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 文件: 代码: import pprintmessge = 'It was a bringht cold day in April,and the clocks were striking thrirteen'count = {}for char in messge: count.setdefaul 阅读全文
posted @ 2019-07-14 11:42 oceansharks 阅读(665) 评论(0) 推荐(0) 编辑