Q:

Count upper case characters in a string

def n_lower_chars(string):
    return sum([int(c.islower()) for c in string])
1
def n_upper_chars(string):
    return sum([int(c.isupper()) for c in string])
1

New to Communities?

Join the community