一.习题收藏 5.写函数,计算传入字符串中[数字].[字母].[空格] 以及 [其他]的个数,并返回结果. # def func4(s): # dic = { # 'num':0,'alpha':0,'space':0,'others':0 # } # for i in s: # if i.isdigit(): # dic['num'] += 1 # elif i.isalpha(): # dic['alpha'] +=1 # elif i.isspace(): # dic['space'] +…