filmov
tv
Code 13: Count Consonants and Vowels in a string | 365 days of Code

Показать описание
Python program to count the total number of vowels and consonants in a string.
Code -
string = "Hello, This is Mayank Gupta, and I run Code House"
consonants = "bcdfghjklmnpqrstvwxyz"
vowels = "aeiou"
consonant_number = vowel_number = 0
for each in string:
consonant_number += 1
vowel_number += 1
print("Consonant -", consonant_number,", vowels -", vowel_number)
Code -
string = "Hello, This is Mayank Gupta, and I run Code House"
consonants = "bcdfghjklmnpqrstvwxyz"
vowels = "aeiou"
consonant_number = vowel_number = 0
for each in string:
consonant_number += 1
vowel_number += 1
print("Consonant -", consonant_number,", vowels -", vowel_number)