Advertisement
Peaser

Disemvoweler

Oct 30th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. def disemvowel(text):
  2.     text = [i for i in text if i!=' ']
  3.     vowels = []
  4.     for i in text:
  5.         if i.lower() in "aeiou":
  6.             vowels.append(i)
  7.             text[text.index(i)] = ''
  8.     return "%s\n%s" % (''.join(text), ''.join(vowels))
  9.  
  10. print disemvowel(raw_input("word: "))
  11.  
  12.  
  13. print ''.join(map(lambda i: '\n'.join((''.join([i_ for i_ in i if i_ not in ("aeiou ")]), ''.join([i_ for i_ in i if i_ in "aeiou"]))),raw_input("word: "))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement