strings.count_vowels¶
Functions¶
|
Count the number of vowels in a given string. |
Module Contents¶
- strings.count_vowels.count_vowels(s: str) int ¶
Count the number of vowels in a given string.
- Parameters:
s – Input string to count vowels in.
- Returns:
Number of vowels in the input string.
Examples: >>> count_vowels(“hello world”) 3 >>> count_vowels(“HELLO WORLD”) 3 >>> count_vowels(“123 hello world”) 3 >>> count_vowels(“”) 0 >>> count_vowels(“a quick brown fox”) 5 >>> count_vowels(“the quick BROWN fox”) 5 >>> count_vowels(“PYTHON”) 1