递归打印字符串
完成如下功能:
1. 递归从后向前。
123456->654321
def f(s): if len(s) == 1: print s else: print s[len(s) - 1], f(s[:len(s) - 1])
2. 递归取两边
123456->162534
def f(s, beg = 0): end = len(s) - 1 - beg if beg <= end: print s[beg], s[end], beg += 1 f(s, beg)