Anti_vowel


#1

x=raw_input('')
def anti_vowel(text):

y=tuple(str(text))
for i in y:
    if i=='a' or i=='e' or i=='i' or i=='o' or i=='u':
        print y.index(i)
        print i
        **z=y.replace(i,"")**(it's showing error as cannot be used in tuple)
        print z
return y

print anti_vowel(x)

Can anyone please help me in writing a remove statement using the same code as above ?
thanks


#2

I have skipped caps "AEIOU"


#3

why would you use a tuple()?


#4

I tried to separate the characters in the text and then remove it...


#5

but tuples are immutable, and .replace() is a method for string

we can loop over a string the same way we can loop over a tuple:

a = ('a','b','c')
for i in a:
     print i
b = 'abc'
for i in b:
    print i

#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.