递归实例应用五:字符串反转,逐行输出
def spell(txt):
if txt == "" or len (txt) == 0:
return txt
else:
print (txt[-1])
return spell(txt[:len(txt)-1])
txt = input()
spell(txt)
递归实例应用五:字符串反转,逐行输出
def spell(txt):
if txt == "" or len (txt) == 0:
return txt
else:
print (txt[-1])
return spell(txt[:len(txt)-1])
txt = input()
spell(txt)