📜  反向字符串python代码示例

📅  最后修改于: 2022-03-11 14:46:34.049000             🧑  作者: Mango

代码示例6
def reverse(s: str):
  reversed = ""
  for ch in s:
    reversed = ch + reversed
  return reversed

s = "abcd"
print(reverse(s))