7. Reverse


#1

Hi guys (and girls),
I tried different codes and they work but I always get the same error message " 'str' object is not callable"
Don't know what that mean and how to fix this. Could you help me?
Here is my codes:


#2

could you copy paste your code to the forum? This way, i can run it (which helps me, to help you :slight_smile: ), also, the url of the exercise would be very useful :slight_smile:


#3

Thank for your help :slight_smile:

# code 1 
def inverser(texte):
    res=''
    for elt in texte:
        res=elt+res
    return res

code 2

def inverser(texte):
    res=''
    i=len(texte)
    while i>0:
        res+=texte[(i-1)]
        i-=1
    return res

URL

https://www.codecademy.com/fr/courses/python-intermediate-fr-FR-py0yl/1/1?curriculum_id=5370f030fed2a866a2000001


#4

i even tried a different solution without strings:

def inverser(texte):
    res=[]
    for elt in texte:
        res.insert(0,elt)
    return "".join(res)
print inverser("coolstory")

still not working.... I will ask around if this is a known problem


#5

This seems to be a known problem, i will see if there is a workaround, for know skip it, trust me, both your solution are really good :slight_smile:


#7

Hi, did you find a solution to skip this exercice? I'm always blocked here :disappointed_relieved:


#8

You can always skip it with the hamburger menu in the bottom left, i believe there was a workaround... Or not, i will have to ask one of the other mods.


#16

Guys, posting answers is not according to the guidelines, besides that, it is not going to help since this is the french exercise, which is bugged.