Skip to content

Commit

Permalink
i update that function and make it fast
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliwahid17 authored Jul 2, 2022
1 parent 63a2628 commit e202c59
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Count the Number of Each Vowel
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@

vowels = 'aeiou'

ip_str = 'Hello, have you tried our tutorial section yet?'

ip_str = ip_str.casefold()

count = {}.fromkeys(vowels,0)
count = 0

for char in ip_str:
if char in count:
count[char] += 1
if char in vowels:
count += 1

print(count)

0 comments on commit e202c59

Please sign in to comment.