Skip to content

Commit

Permalink
chore: add disemvowel solution
Browse files Browse the repository at this point in the history
  • Loading branch information
mbazhlekova committed Mar 19, 2021
1 parent 5002899 commit 5ec5046
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions python/disemvowel-trolls.py
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"))

0 comments on commit 5ec5046

Please sign in to comment.