Please help me to use python write this question thanks Writ

Please help me to use python write this question, thanks.

Write a function called remove_vowels that takes a string as input and returns a new version of that string with the vowels removed.

Solution

Please follow the code and comments for description :

CODE :  

def remove_vowels(text): # defining the function that takes in a string input
     vow = [\"a\", \"e\", \"i\", \"o\", \"u\"] # a list that saves the vowels
     chars = [] # empty list of characters to save the result
     for i in text: # looping over the lists for checking the vowels
         if i.lower() not in vow: # if the character is not a vowel
             chars.append(i) # appending the charcters list to the new list
     return \"\".join(chars)   # returning the data with the charcters appended
  
OUTPUT :

>>> remove_vowels(\"Hey look at the Words below!\")
\'Hy lk t th Wrds blw!\'
  
  
Hope this is helpful.  

Please help me to use python write this question, thanks. Write a function called remove_vowels that takes a string as input and returns a new version of that s

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site