Solution: Getting Started
Let's look at the solution to the previous exercise.
We'll cover the following...
We'll cover the following...
Exercise 1
Python 3.5
def vowelCount(word):vowel = ['a','e','i','o','u']count = 0word = word.lower()for x in vowel:count = count + word.count(x)return countprint(vowelCount('Gilles De Rais'))
Explanation
Line 2: We define the
vowellist, which contains the vowels in the English alphabet.Line 3: The word is converted into lowercase using the
lower()method.Line 4: The
countvariable is set to 0. ...