forked from arvimal/100DaysofCode-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path05-anti-vowels-1.py
More file actions
28 lines (22 loc) · 748 Bytes
/
05-anti-vowels-1.py
File metadata and controls
28 lines (22 loc) · 748 Bytes
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
#!/usr/bin/env python3
def anti_vowels(text):
vowels = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]
text_list = list(text)
# Remove vowels
# pdb.set_trace()
for pos in range(len(text_list)):
for i in text_list:
# print("Iterating {}".format(i))
if i in vowels:
# print("{} is present in {}".format(i, vowels))
# print("Removing {}".format(i))
text_list.remove(i)
# print(text_list)
# Create the string back from the list
text_new = ""
for i in text_list:
text_new += i
print(text_new)
# anti_vowels("Hey how are you tuodayu")
anti_vowels("Hey look Words!")
anti_vowels("Hey, how are you today?")