代码示例:(标识:python_howto_reverse_string_2)
python_howto_reverse_string_2.py
def my_function(x):
  return x[::-1]

mytxt = my_function("I wonder how this text looks like backwards")

print(mytxt)
运行结果: