Считайте символы верхнего регистра в строке

def n_upper_chars(string):
    return sum([int(c.isupper()) for c in string])
Friendly Flatworm