/* 一: 字符串反转 1 code 2 原理图 */
一: 字符串反转
1 code
def traverse(s): print(s) if len(s) == 0: return s return traverse(s[1:]) + s[0] if __name__ == '__main__': s = "abcd" s1 = traverse(s) print(s1)
2 原理图
标签:__,traverse,code,return,递归,s1,原理图 From: https://www.cnblogs.com/huafan/p/17363210.html