Count of camel case characters present in a given string | Function to count all the camelcase characters in the string S ; Stores the total count of camelcase characters ; Traverse the string S ; If ASCII value of character lies over the range [ 65 , 91 ] then increment the count ; Print the total count obtained ; Driver Code
def countCamelCase ( S ) : NEW_LINE INDENT count = 0 NEW_LINE for i in range ( len ( S ) ) : NEW_LINE INDENT if ( ord ( S [ i ] ) >= 65 and ord ( S [ i ] ) <= 91 ) : NEW_LINE INDENT count += 1 NEW_LINE DEDENT DEDENT print ( count ) NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT S = " ckjkUUYII " NEW_LINE countCamelCase ( S ) NEW_LINE DEDENT