7. Reverse Reversed error?

  1. List item

Hi, Here is my problem i don't manage to valid my code :confused:
Please help me :smile:


This is the error:
"Oops, try again. Hey now! No using [::-1] or reversed()."

There are the instructions:
Define a function called reverse that takes a string textand returns that string in reverse.
For example: reverse("abcd") should return "dcba".
You may not use reversed or [::-1] to help you with this.
You may get a string containing special characters (for example, !, @, or #).

And finally my code:

def reverse(text):
    result = ""
    reversed_text = reversed(text)
    for char in reversed_text:
        result += char
    print result
    return result


the instructions specificly state you are not allowed to user reversed(), look at this line of your code:

reversed_text = reversed(text)

i see you are using reversed, that is cheating. The exercise is designed to catch this. You will have to do it without reversed


Oh !!!!! Im stupid I don't read the instructions well (Im not english sorry) and Thanks for the help :slight_smile: