Practice makes perfect 7. reverse
Hey everyone, this is my code and it's running and return the reverse of Python!, but I'm still getting this module failure:
Oops, try again. Your function fails on reverse("Python!"). It returns "['!', 'n', 'o', 'h', 't', 'y', 'P']" when it should return "!nohtyP".
I'm not sure if I just have formatting incorrect or what, which is most likely. Help!
a = "Python!" def reverse(text): #to set x to last character in text x = len(text) - 1 #empty string to append last character to t =  for i in text: t.append(text[x]) x -= 1 print ''.join(t) return t reverse(a)