📜  python代码示例中的字符串反转

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

代码示例6
#linear

def reverse(s): 
  str = "" 
  for i in s: 
    str = i + str
  return str

#splicing
'hello world'[::-1]