标签:pytho class pre 统计 lan highlight div input python
输入一个字符串,统计其中数字字符及小写字符的个数
输入一行字符串
共有?个数字,?个小写字符,?填入对应数量
helo134ss12
共有5个数字,6个小写字符
s = input()
count = 0
cnt = 0
for i in s:
if i <= ‘9‘ and i >= ‘0‘:
count += 1
elif i <= ‘z‘ and i >= ‘a‘:
cnt += 1
print("共有%d个数字,%d个小写字符" % (count,cnt))
标签:pytho class pre 统计 lan highlight div input python
原文地址:https://www.cnblogs.com/aimilu/p/11819135.html