计算字符串中al_num,spance_num,digit_num,other_num的个数

 def jisuan(x) :
al_num = 0
spance_num = 0
digit_num = 0
other_num = 0
for i in x :
if i.isdigit() :
digit_num += 1
elif i.isspace() :
spance_num += 1
elif i.isalpha() :
al_num += 1
else :
other_num += 1
return (al_num,spance_num,digit_num,other_num) r= jisuan("qwerrwqrqrwqr erwqrdsfdad#sfa") print(r)
上一篇:Wpf 导出CSV文件


下一篇:java包装类和值类型的关系