Anti_vowel


#1


anti_vowel

my code is working fine. I have a doubt. In my code , the value of text is changing bcoz of loop.So why its not showing error because the value of 'text' changing in for loop.(i thought for loop gives error when it iterates through changing value)


def anti_vowel(text):
    for c in"aeiouAEIOU":
        for j in  text:
            if c in text:
                text=text[:text.index(c)]+text[text.index(c)+1:]
    return text
    
text=raw_input("Enter you string: ")
print anti_vowel(text)


#2

No? why should the loop give an error?


#3

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