8/15 : anti vowel


#1



Hi guys,
I need some help here.
After trying different possibilities and reading some posts, I came up with this code :slight_smile:

def anti_voyelle(texte):
for lettre in "aeiouAEIOU":
texte = texte.replace(lettre, "")
return texte
print anti_voyelle("bonjour")

https://www.codecademy.com/fr/courses/python-intermediate-fr-FR-py0yl/1/2

The output seems correct but I get this error message ""'str' object is not callable".


Help please


Replace this line with your code.


#2

I tried this too and I get the same error message above :

def anti_voyelle(texte):
    vowels = ["A", "a", "E", "e", "I", "i", "O", "o", "U", "u"]
    anti = []

    for i in texte:
        if i not in vowels:
            anti+=i
    return "".join(anti)
     
print anti_voyelle("bonjour")

#3

Could be an SCT issue. Inviting a couple of members who are adept at finding the issue. They might be able to offer a work around.


#4

The exercises aren't locked though, just go to the next one after having controlled yourself that your function is behaving as it should by testing it a few times.

but sure, it can be made to crash by adding

chr = None

at the top level of the file (outside your function, such as at the very top or bottom of the code)


#5

In the early days all of the foreign language lessons worked and I had no problem passing everything. It didn't become an issue until last year some time. That's when these work arounds started to surface. Something got changed at some point 1-2 years ago.


#6

They translated my bugfixes, adding new bugs in the process. Not sure why they bothered or why they also decided that the code should be translated as opposed to just the strings.

Having anything in non-English is surely only so that they can say that they do, it's not something they are able to support.

I think people are better off just learning English? If they haven't gotten around to that in school yet then they would probably need personal tutoring for programming anyway


#7

Thank u all for your answers. It just worked a couple of hours later.
Sorry for my late reply


#8

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