How to calculate the number of vowels and consonants in a string ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to calculate the number of vowels and consonants in a string ?

Your advice means a lot to me. Help ✍️

22nd Nov 2022, 11:04 AM
⭐️- 🆂︎🅰︎🅹︎🅸︎🅳︎ -⭐️
⭐️- 🆂︎🅰︎🅹︎🅸︎🅳︎ -⭐️ - avatar
1 Answer
+ 5
s = input() c = 0 for ch in s.lower(): if ch in "aeiou": c +=1 print(c)
22nd Nov 2022, 11:22 AM
SoloProg
SoloProg - avatar