def anti_vowel(text):
word = []
for i in text:
if i in ("aeiouAeiou"):
text.replace(i, "")
string = "".join(word)
print string
anti_vowel("Hey look Words")

It prints Hy lk Wrds. It says that it prints None :disappointed_relieved:. What s the matter?


You should return string in anti_vovel(text) function.
Replace line print string with return string
Then under definition use print anti_vowel("Hey look Words")


yup sorry and i wrote "aeiouAeiou" instead of "aeiouAEIOU" :joy:
Thank you anyways :slight_smile:


Instead of an empty list, since you input will always be a string you should create an empty string like so,

word = " "


What you are trying to do here works but is less legible. How about using the not in keyword like,

for i in text:
   if i not in "aeiouAEIOU":
        #Then just add all the contents into your empty string
        word += i
        #After doing so for your anti_vowel text to show up when called return the now filled string
return word

After doing all that your code should work :grin:


thank you :slight_smile:


opps, .............................didnt mean to reply


def reverse(text):
rev = ""
n = len(text) - 1
while n >= 0:
print text[n],
n -= 1


But this gives this as reply - ! n o h t y P
how do i eliminate spaces between them so it gives result as !nohtyP

PS: The code is indented properly. I am not able to indent it here properly.


Thanks i figured it out, Now i am stuck at Purify function.


Still stuck? :slight_smile:


No. I am almost done with the course. At 98%. Thanks though.