# a = 'abcdefccdd'
# 展示的结果:{'a':2, 'b':3, 'd':4}
a = 'abcdefccdd'
a_dict={}
cnt=0
for i in a:
if i not in a_dict:
# a_dict[i] = 1
a_dict.update({i:1})
else:
a_dict[i]+=1
print(a_dict)
# a = 'abcdefccdd'
# 展示的结果:{'a':2, 'b':3, 'd':4}
a = 'abcdefccdd'
a_dict={}
cnt=0
for i in a:
if i not in a_dict:
# a_dict[i] = 1
a_dict.update({i:1})
else:
a_dict[i]+=1
print(a_dict)
本文标题:a = 'abcdefccdd' ,展示的结果:{'a':2,
本文链接:https://www.haomeiwen.com/subject/dzxlldtx.html
网友评论