Practice Makes Perfect: reverse


#1



https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/1/1


I can't understand how to join the individual string(I mean character , like "A", "B") that is created by for loop


Replace this line with your code. 
def reverse(text):
    adn = len(text)
    line = ""
    if adn >= 0:
        for i in text:
           line += text[adn-1]
            return line
            adn = adn-1 
reverse("Python!")


#2

+= will do that, perhaps your problem is something else. If you're only getting a single character then the problem is not that you didn't join them, but that you only included one.

Also, note that your code will not run, its syntax is not valid.


#3

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