Practice makes perfect


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
I am stuck at Practice makes perfect

<In what way does your code behave incorrectly? Include ALL error messages.>
Error - " Your function fails on reverse(“Python!”). It returns “None” when it should return “!nohtyP”."
However when i tried manually, it worked!.
<What do you expect to happen instead?>

```python

def reverse(text):
rev_text = []
for x in range(len(text)):
rev_text.append(text[len(text) - x - 1]) #Bcoz index starts with 0
print “”.join(rev_text)

<do not remove the three backticks above>

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

#2

None is the default returned by functions, so your function doesn’t return the reversed string.


#3

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