There are 5 alphabets representing vowels while the rest of the alphabets among the 26-letter alphabets are called consonants. We will iterate through each character in the input string. A counter needs to be initialized which will increment every time it iterates through a vowel. This will give us the count of the number of vowels in a string. The count of number of consonants can be derived from the vowel count and the length of the string. This can be implemented in python as –  input_string = 'assembly language'
input_string = input_string.lower()
vowel_list = ['a', 'e', 'i', 'o', 'u']
str_length = len(input_string)
vowel_count = 0
for idx in range(0, str_length):
if input_string[idx] in vowel_list:
vowel_count += 1
print(f'There are {vowel_count} vowels and {str_length - vowel_count} consonants in the string')  The output of the above program will be “There are 6 vowels and 11 consonants in the string”.