Learn Python - reverse


#1

I get this error when running the below code. Please help me, thank you.

def reverse(text):
retxt = ""
a=len(text)-1
while a >= 0:
retxt += text[a]
a-=1
print retxt
Your function fails on reverse(“Python!”). It returns “None” when it should return “!nohtyP”.


#2

Did you return retxt?
Hình như ông chưa có return thì phải.


#3

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