Optional/Keyword Parameters Examples

Session 12 In Class Code Samples: PS 5 Q 8

Review: Rephrasing problems in English

Optional/Keyword Parameters Examples

Here’s a function count_vowels that takes a string and counts how many vowels are in it.

Now using that as a basis, you should generalise the count_vowels function, to count the occurrences of any subset of letters, not just vowels, but treat vowels as the default if not otherwise specified. Fill in the parameter list and the code.

Next Section - Tuples and Nested Data