Answer in Python for Raj #265038
January 26th, 2023
Given a string that other than letters, numbers, and space if any characters are there
print the count of those characters.
string = "The best of both worlds"; count = 0; #Counts each character except space for i in range(0, len(string)): if(string[i] != ' '): count = count + 1; #Displays the total number of characters present in the given string print("Total number of characters in a string: " + str(count))