Advertisement
ellp

Remove wogels

Jul 9th, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. state_names = ["Alabama","California","Oklahoma","Florida"]
  2. vowels = list('aeiou')
  3. output = []
  4.                
  5. for state in state_names:
  6.     state_list=list(state.lower())
  7.                              
  8.     for vowel in vowels:
  9.               while True:
  10.                         try:
  11.                              state_list.remove(vowel)
  12.                         except:
  13.                              break
  14.     output.append(''.join(state_list).capitalize())
  15.    
  16.    
  17.    
  18.     print(output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement