# 实现输入一个字符串,统计每个字符串出现次数且实现字符串反转
from functools import reduce
def count_char(string):
z = {}
for i in string:
if i not in z:
z[i]=1
else:
z[i]+=1
return z
i=count_char(input("请输入一个字符串:"))
print('你输入的字符串每个字符出现次数为:',str(i))
print(reduce(lambda x, y: y + x, i))