解析: import string s=input('please input string:' letters✉0 space女0 digit =0 others =0 for ch in s: dx COMP #是否为字母 03 tan E if ch.isalpha0: DMS F/S DIR letters +=1 种是否为空格 ARG 8 IRI elif ch.isspace0: 9 space+=1 5 RCL 种是否为敬字 1 为 6 M+ elif ch.isdigito: 2 digit+=1 else: 0 3 others +=1 print(letters,space,digit,others) 选择判断语句 isalpha(0是否为字母 isspace0是否为空格 isdigit0是否为数字 04