-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5002899
commit 5ec5046
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
Trolls are attacking your comment section! | ||
A common way to deal with this situation is to remove all of the vowels from the trolls' comments, neutralizing the threat. | ||
Your task is to write a function that takes a string and return a new string with all vowels removed. | ||
For example, the string "This website is for losers LOL!" would become "Ths wbst s fr lsrs LL!". | ||
Note: for this kata y isn't considered a vowel. | ||
""" | ||
|
||
|
||
def disemvowel(string): | ||
vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'] | ||
result = '' | ||
for char in string: | ||
if (char not in vowels): | ||
result += char | ||
return result | ||
|
||
|
||
print(disemvowel("helloHELLO")) |