define a function called reverse that takes a string text and return that string in reverse.
You may get a string containing special characters(for example,!,@,or #).
def reverse(text)
char = len(text) - 1
st = ""
while char >= 0:
st += text[char]
char -= 1
return st
def reverse(text):
st =""
while len(text)>0:
char = text[len(text)-1]
st += char
char -= 1
return st
return 前面也可以加else
else:
return st
while 前面也可以加个for 循环
for x in text:
while