-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkata5.py
73 lines (26 loc) · 1.07 KB
/
kata5.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#Disemvowel Trolls
#rolls 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): #error when attempt
a=string.split()
c=[]
for i in a:
b=[]
for j in i:
if j in "aeiouAEIOU":
continue
b.append(j)
d="".join(j for j in b)
c.append(d)
return " ".join(k for k in c)
v=disemvowel("This website is for losers LOL")
print(v)
def disemvowel1(string): #submitted
for i in "aeiouAEIOU":
string = string.replace(i,"")
return string
v=disemvowel1("This website is for losers LOL")
print(v)