Python統計字符串中每一個字母,數字,空格的個數

def countt(): zifu = input('輸入字符串:') li = ['alpha','digit','space','others'] a_dict = dict.fromkeys(li,0) key = [] for i in zifu: if i.isalpha(): a_dict['alpha'
相關文章
相關標籤/搜索