计算字符串中大小写个数python

计算字符串中大小写个数python,第1张

 def seperate(word):
    big = 0;small = 0
    for c in word:
        if 65<=ord(c)<=90:
            big += 1
        elif 97<=ord(c)<=122:
            small += 1
        else:
            continue
    return (big,small)
word = input()
print(seperate(word))

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/714026.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-04-24
下一篇2022-04-24

发表评论

登录后才能评论

评论列表(0条)

    保存