Merge pull request #66 from kuingsamlee/master
fixed count_vowels function return value error.
This commit is contained in:
@ -7,12 +7,9 @@ Use a regular expression to count the number of vowels `(A, E, I, O, U)` in a st
|
||||
```python
|
||||
import re
|
||||
|
||||
def count_vowels(str):
|
||||
return len(re.findall(r'[aeiou]', str, re.IGNORECASE))
|
||||
|
||||
def count_vowels (str):
|
||||
return len (re.findall (r '[aeiou]', str, re.IGNORECASE))
|
||||
`` `
|
||||
|
||||
`` `python
|
||||
print(count_vowels('foobar')) # 3
|
||||
print(count_vowels('gym'))# 0
|
||||
count_vowels('foobar') # 3
|
||||
count_vowels('gym')# 0
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user