Skip to content

Commit

Permalink
Debugging!
Browse files Browse the repository at this point in the history
  • Loading branch information
snehalmastud authored Feb 23, 2020
1 parent 2987d3b commit bba386c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Debugging/Words Score/Solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def is_vowel(letter):
return letter in ['a', 'e', 'i', 'o', 'u', 'y']


def score_words(words):
score = 0
for word in words:
num_vowels = 0
for letter in word:
if is_vowel(letter):
num_vowels += 1
if num_vowels % 2 == 0:
score += 2
else:
score += 1
return score

0 comments on commit bba386c

Please sign in to comment.