my_str = 'wednesday'
输出应该是
d = {'w':1,'e':2,'d':2,'n':1,'s':1,'y':1,'a':1}
有没有直接的内置函数?
python string dictionary
dictionary ×1
python ×1
string ×1