请帮我补充这段程序def reserse(s): ns=__ i,j=0,-1 while i< len(s): ns[i]=__ _____ j=j-1 return___
时间: 2024-02-15 10:50:35 浏览: 54
答:请帮我补充这段程序:
def reserse(s):
ns=['']*len(s)
i,j=0,-1
while i< len(s):
ns[i]=s[j]
i+=1
j=j-1
return ''.join(ns)
该程序实现的功能是将字符串s反转。
相关问题
补充这段程序def reserse(s): ns=__ i,j=0,-1 while i< len(s): ns[i]=__ _____ j=j-1 return___
def reverse(s):
ns=['']*len(s)
i = 0
j = -1
while i < len(s):
ns[i] = s[j]
i += 1
j -= 1
return ''.join(ns)
阅读全文