How to write a python program to count vowels, consonant, digits and special characters in string.
A string and its job are to count the vowels, consonants, numbers, and special characters in the string. Special characters also contain spaces using Python . Examples: Input : str = "geeks for geeks121" Output : Vowels: 5 Consonant: 8 Digit: 3 Special Character: 2 Input : str = " A1 B@ d adc" Output : Vowels: 2 Consonant: 4 Digit: 1 Special Character: 6 Program: # Python3 Program to count vowels, # consonant, digits and special # character in a given string. # Function to count number of vowels, # consonant, digits and special # character in a string. def countCharacterType(str): # Declare the variable vowels, # consonant, digit and special # characters vowels = 0 consonant = 0 specialChar = 0 digit = 0 # str.length() function to count # number of character in given string. for i in range(0, len(str)): ch = str[i] if ( (ch >= 'a' and ch <= 'z') or (ch >= ...