Question: Please program in python. thank you. Problem 1. You are given the following list of English vowels. vowels=[a,o,i,u,e] Using the idea of a counter, implement

Please program in python. thank you.

Please program in python. thank you. Problem 1. You are given the

Problem 1. You are given the following list of English vowels. vowels=["a","o","i","u","e"] Using the idea of a counter, implement a program that asks the user for a word, and then prints the number of consonants in that word. (For simplicity, we assume that " y " always behaves as a consonant, even though it is not true. Problem 2. Implement a program that asks the user for the value of n and for a word, and extracts n-grams from that word for any n provided by the user. word: banana n:2 ngrams: ba, an, na, an, na word: linguist n:3 ngrams: lin, ing, ngu, gui, uis, ist Hint 1 If you didn't do it for practice before, start by implementing a code that extracts all bigrams. Then think about how you can generalize it to arbitary n. Hint 2 Be careful with the edges (i.e., the last n gram in each word). And what happens if the word is shorter then the n-gram? (i.e, the word is "hi" and n=3? You still need to list "hi"!) Important There are multiple default libraries to extract n-grams, already available in Python. But for this homework you must use the concepts we have studies so far. Any solution involving an external library will be counted as 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!