The code gives me the following error
Oops, try again. Your function fails on reverse("Python!"). It returns "None" when it should return "!nohtyP".

I want to see where is the error and try to learn how to solve them. Thank you!

def reverse(text):
    m = list(text)
    for c in range(len(m), 0):
        return c


read instructions carefully as well check out range documentation. you need to return value in a new list.


Are you doing really correctly per instructions?

These were 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 #).


You try it:


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