Answers for "16. count total numbers of uppercase and lowercase characters in input string python"

0

16. count total numbers of uppercase and lowercase characters in input string python

s = "The Geek King"
l,u = 0,0
for i in s:
    if (i>='a'and i<='z'):
          
        # counting lower case
        l=l+1                 
    if (i>='A'and i<='Z'):
          
        #counting upper case
        u=u+1   
          
print('Lower case characters: ',l)
print('Upper case characters: ',u)
Posted by: Guest on April-28-2022

Code answers related to "16. count total numbers of uppercase and lowercase characters in input string python"

Python Answers by Framework

Browse Popular Code Answers by Language