Write a python program to extract the non-vowel words in a sentence.

Input: This machine learning project is challenging.

Output: def extract_words(sentence):
non_vowel_words = []
words = sentence.split()
vowels = [‘a’,’e’,’i’,’o’,’u’,’A’,’E’,’I’,’O’,’U’]
for word in words:
if not any(char in vowels for char in word):
non_vowel_words.append(word)
return non_vowel_words

Prompt: Below is an instruction that describes a task. Write a response that appropriately completes the request.

### Instruction:
Write a python program to extract the non-vowel words in a sentence.

### Input:
This machine learning project is challenging.

### Output:
def extract_words(sentence):
non_vowel_words = []
words = sentence.split()
vowels = [‘a’,’e’,’i’,’o’,’u’,’A’,’E’,’I’,’O’,’U’]
for word in words:
if not any(char in vowels for char in word):
non_vowel_words.append(word)
return non_vowel_words

editor
We will be happy to hear your thoughts

Leave a reply

vesaire.com
Logo
Compare items
  • Total (0)
Compare
0
Shopping cart