import re
reg = "[^0-9A-Za-z\u4e00-\u9fa5]"
#str = 'who have an apple apple is free free is money you know'
str1 = input("输入一段英文句子:")
str2 = re.sub(reg,' ',str1)
list = str2.split(' ')
set={}
for i in list:
if i not in set.keys():
set[i] = list.count(i)
print(set)
执行结果