Question 3: (3 marks)
Write a function that takes a text and a vocabulary as its arguments and returns the set of words that appear in the text and in the vocabulary. Both arguments can be represented as lists of strings.
Example:
Input:text = 'a text and a vocabulary
vocab 'a vocabulary'
Output:
['a', 'vocabulary']
Question 4: (3 marks)
Write code to initialize a two-dimensional array of sets called word_vowels and process a list of words, adding each word to word_vowels[1][v] where 1 is the length of the word and v is the number of vowels it contains. Print 1 and v
Example:
Input:
word_list = 'Write code to initialize an array and process a list of words'
5
1
Zoom
Output:
+ 100%
Close