how to count small letters in a string python code example
Example 1: Count lower case characters in a string
def n_lower_chars(string):
return sum([int(c.islower()) for c in string])
Example 2: Count upper case characters in a string
def n_upper_chars(string):
return sum([int(c.isupper()) for c in string])