WAP to count number of vowels ,consonents, digits and space in a string in python with output
Answers
Explanation:
Program to count the number of vowels, consonants, digits and special characters in a string are discussed here. Given a string, print the count of vowels, consonants, digits, spaces and special characters.
Input and Output Format:
Input consists of a string. Assume the maximum length of the string is 200. The characters in the string can contain both uppercase and lowercase.
Sample Input & Output format:
Input:
This program is very easy 2 complete
Output:
Vowels : 10
Consonants : 19
White spaces : 6
Digits : 1
Symbols : 0
Algorithm to count the number of vowels, consonants, digits and special characters in a string
Input the string from the user.
Initialize vowels = consonants = digits = symbols = spaces = 0.
Check every character and the string and update the variables accordingly.
Print all the variables.
Answer:
❤️❤️☺️☺️
Explanation:
Program to count the number of vowels, consonants, digits and special characters in a string are discussed here.
- Input the string from the user.
- Initialize vowels = consonants = digits = symbols = spaces = 0.
- Check every character and the string and update the variables accordingly.
- Print all the variables.