STACK IN PYTHON QUESTION – 4 WITH SOLUTION

Опубликовано: 13 Март 2026
на канале: proco
662
17

Write the definition of a user defined function PushNV(N) which accepts a list of strings in the parameters N and pushes all strings which have no vowels present in it, into a list named NoVowel.Write a program in python to input 5 words and push them one by one into a list named All. The program should then use the function PushNV() to create a stack of words in the list NoVowel so that it stores only those words which do not have any vowels in it, from the list All.
Thereafter , pop each word from the list NoVowel and display the message
“EmptyStack” For example: If the words accepted and pushed into the list All are
[‘DRY’,’LIKE’,’RHYTHM’,’WORK’,’GYM’]
Then the stack NoVowel should store: [‘DRY’,’RHYTHM’,’GYM’]
And the output should be displayed as
GYM RHYTHM DRY EmptyStack