07. Reverse (French Version)


#1



Hi everyone, I use the French version and I have also tried with French variable names but the result is the same. We all know that a picture is worth a thousand words :


#2

Looks fine to me. Try refreshing the page and submitting again.


#3

I tried like a thousand things different (including refreshing the page) but still the same result... Maybe this part of the course doesn't work well !?!


#4

Strange...Your code worked in the English version.
Perhaps change your reverse(text) to inverser(texte) with all text being replaced to texte. I'm also seeing this in the French version. Exact same code but that error message pops up. I even tried changing browsers but that didn't help. Perhaps it doesn't work well. The code looks fine. I suggest you move on.


#5
  1. You may not use reversed or [::-1] to help you with this.
    Reading is hard.

#6

Yes, but they didn't use [::-1] here.


#7

def inverser(texte):
    result=""
    for e in range(len(texte)-1,-1,-1):
        result+=texte[e]
    return result 
        
print inverser("Python!")

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

The answer is good but there is a error message


#8

def reverse(text):
new_string = []
index = len(text)
while index:
index -= 1
new_string.append(text[index])
return "". join(new_string)

hope this code will help :slight_smile:


#9

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