摘要:
3、统计列表英文字母的单词个数 d = ["a","uhhj","jlkjn",,"jlkjn"] 方法一: data = list(set(d))dictcount = {}for i in data: dictcount[i]=d.count(i) 方法二: dictcount = {}for 阅读全文
摘要:
输入一行非中文字符,分别统计出其中英文字母、空格、数字和其他字符的个数 def countzimu(): dict = {} shuzi = 0 zimu = 0 space = 0 other = 0 str = input("请输入任意字符:") for i in str: if i.isdig 阅读全文