1.str.isupper()#用来判断是否为大写字母
2.str.islower()#用来判断是否为小写字母
3.str.isdigit#用来判断是否为数字
count1,count2,count3,count4=0,0,0,0
string=input("请输入一个字符串:")
for s in string:
if s.isupper():
count1+=1
elif s.islower():
count2+=1
elif s.isalnum():
count3+=1
else:
count4+=1
print("大写字母有:"+str(count1)+"\t"+"小写字母有:"+str(count2)+"\t"+"数字有:"+str(count3)+"\t"+"其他字符有:"+str(count4))