Go Back

Python program to counting consonants in a given word example

Sat Nov 25 2023 09:20:54 GMT+0000 (Coordinated Universal Time)
All Articles

Python program counting consonants in a given word example

 Python program to  counting consonants in a given word



vowel = ['a', 'e', 'i', 'o', 'u']
word = "Developer Indian programming"
count = 0
for character in word:
    if character not in vowel:
        count += 1
print(count)

Conclusion

The idea behind the Python programme to count the vowels or consonants in a given string will be covered in this article.

This article will teach you how to use the Python programming language to count the vowels and consonants in a given string.

 

showing an illustration of  Python program to  counting consonants in a given word example  and <h1 id="python-program---counting-consonants-in-a-given-word-example">Python program   counting consonants in a given word example</h1>

Article