Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #66 from kuingsamlee/master
Browse files Browse the repository at this point in the history
fixed count_vowels function return value error.
  • Loading branch information
Chalarangelo committed Jul 18, 2019
2 parents be0d1cb + 94d41fb commit e28ba07
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions snippets/count_vowels.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit e28ba07

Please sign in to comment.