Pythonで文字列を逆にする方法

def my_function(x):
  return x[::-1]

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

print(mytxt)

文字列を切断し、文字列の末尾から移動を開始した後。

公開された186元の記事 ウォン称賛21 ビュー10000 +

おすすめ

転載: blog.csdn.net/sinat_23971513/article/details/105280835