In Exercises 25 through 30 determine the value of list2 wher
Solution
Here is the solution to all the problems:
list1 = [\"democratic\", \"sequoia\", \"equals\", \"brrr\", \"break\", \"two\"]
list2 = [len(word) for word in list1]
#For each word the length of the word is stored in list2.
#Its a list of integers. And the list2 will be: [10, 7, 6, 4, 5, 3].
list2 = [word.capitalize() for word in list1]
#For every word in the list list1, the first character will be capitalized, and stored in list2.
#And the list2 will be: [\'Democratic\', \'Sequoia\', \'Equals\', \'Brrr\', \'Break\', \'Two\']
list2 = [word.upper() for word in list1 if len(word) < 5]
#For each word in the list list1, all characters in the string will be converted to uppercase,
#and stored in list2 only if the the number of characters in the word is less than 5.
#And the list2 will be: [\'BRRR\', \'TWO\']
list2 = [word for word in list1 if numberOfVowels(word) > 3]
#For each word in list1, if the number of vowels is grater than 3, it is added to the list2.
#democratic has the vowels e, o, a, and i, so is added to list2.
#sequoia has the vowels e, u, o, i, and a, so is added to list2.
#equals has the vowels e, u, and a, so is not added to list2.
#brrr has no vowels, so is not added to list2.
#break has vowels e, and a, so is not added to list2.
#two has vowels o, so is not added to list2.
#Finally, list2 will be: [\'democratic\', \'sequoia\']
