I've seen more elegant solutions to the reverse problem, but I just wanted to know why this doesn't work.
When I run it, I get the "returns '!' when it should return '!nohtyP'" message.
Overlooking the fact that the code won't display the text as it should, why doesn't it loop the same number of times as there are characters in "text"?
def reverse(text): y = 1 for c in text: return text[len(text) - y] y + 1