题解 | #使用字典计数#
使用字典计数
https://www.nowcoder.com/practice/74f7e7f2344f4754bc56d862838cbfc3
a = input() b = [] c = [] for i in a: j = a.count(i) b.append(i) c.append(j) print(dict(zip(b, c))) # zip字典封装&根据字典的不重复性
使用字典计数
https://www.nowcoder.com/practice/74f7e7f2344f4754bc56d862838cbfc3
a = input() b = [] c = [] for i in a: j = a.count(i) b.append(i) c.append(j) print(dict(zip(b, c))) # zip字典封装&根据字典的不重复性
相关推荐