So assuming I've already defined a function called vowel_call that draws out only the vowels from a string, how do I integrate this function into another function called nonvowels to return a string of only nonvowels from a general string?
def nonvowels (word: str) -> str:
result = ''
for x in word:
if vowel_call(x) == False:
result = result + x
return result
assert nonvowels('book') == 'bk'
assert nonvowels('giraffe') == 'grff'
I tried the code without the assert statements, and Python only gives back the first nonvowel of the phrase: (nonvowels('genie') = 'g'), but not 'gn'. With the assert statements, an error is produced. What should I do to fix the code?