Advertisement
karlakmkj

Practice - remove vowels

Feb 16th, 2021
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. # Write a function that takes one string, text, as input and returns the text with all of the vowels removed.
  2.  
  3. def anti_vowel(text):
  4.   res = []
  5.   text = list(text) # make the text and res in the form of a list
  6.   for letter in text:
  7.     if letter not in "aeiouAEIOU":
  8.       res.append(letter)    # then can append each letter into the list
  9.   return "".join(res)
  10.  
  11. print anti_vowel("Hey You!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement