Write a Python program to find the total number of uppercase and lowercase letters in a given string


Topic: Write a Python program to find the total number of uppercase and lowercase letters in a given string

Solution

str1='TestStringInCamelCase'
no_of_ucase, no_of_lcase = 0,0
for c in str1:
    if c>='A' and c<='Z':
        no_of_ucase += 1
    if c>='a' and c<='z':
        no_of_lcase += 1
print(no_of_lcase)
print(no_of_ucase)



List all Python Programs