Python中输入字符串,统计其中数字字符的个数
string1=input("请输入一个字符串:") num=0 for ch in string1 : if ch.isdigit() : num+=1 print(num)