string = 'adfdvsvvvvdffsb' length = len(string) def rev(i): if i == length - 1: print(string[i],end = '') else: rev(i+1) print(string[i],end = '') rev(0) #先自行最后一个,在往前执行 #bsffdvvvvsvdfda print() def sui(num): if num == 1: return 10 else: return 2+sui(num - 1) ss = sui(5) print(ss) #18 只会输出最后一个