Don't know why this is not working with antivowels


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>

```python
vowel = "aeiouAEIOU"
2
def anti_vowel(x):
3
  for i in x:
4
    if i in vowel:
5
      x.replace(i,'')
6
  else:
7
    return x
<do not remove the three backticks above>

#2

you execute a replace action, then .replace() returns the changed string, but you don’t store this returned string anywhere


#3

Also return statement terminates a function so it shouldn’t be inside for loop.
complete the loop first.


#4

its not? Looking at the indent, a for/else is used which is fine


#5

sorry :frowning:

Like after posting that i thought the same.maybe it’s used for for loop.
Though it’s unnecessary.

thank you :slight_smile:


#6

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