Remove


#1


https://www.codecademy.com/courses/python-intermediate-en-rCQKw/1/1?curriculum_id=4f89dab3d788890003000096#

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


#2

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


#3

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

#4

You try it:


#5

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