Hey guys, this code gives me this error message: Oops, try again. Your function fails on reverse("Python!"). It returns "" when it should return "!nohtyP".
However, it prints cba!nohtyP.
So, very close but I have three questions:
1. Why does it say that it returns an empty list?
2. Why does it not matter if in the while statement c>any number but in my opinion it should be larger than -1 regarding the index?
3. Why does it print cba in front of my answer?
def reverse(text): total= text=str(text) c=(len(text)-1) while c>-1: total.append(text[c]) c-=1 return total print ''.join(total)
Help is much appreciated