當前位置:成語大全網 - 書法字典 - Python小程序解決方案。有獎勵嗎?

Python小程序解決方案。有獎勵嗎?

打印('請輸入壹個字符串:')

str=input()

s1=dict()

對於str中的s:

如果s在s1中:

s1[s] +=1

否則:

s1[s] =1

Print('字符串長度%s'%(len(str)))

key=s1.keys()

print(' total * * * has:% s characters ' %(len(key)))

對於i in鍵:

Print('%s出現%s次' %(i,s1[i]),end= ',')