Original title:
Answer the original question:
# ! / Usr / bin / Python # encoding = UTF. 8- # - * - Coding: UTF-. 8 - * - # recursive function call, the inputted five characters, printed out in reverse order. # STR = INPUT () "" " DEF printStr (J): IF STR: S = printStr (J) S = J [-1] J = J [: -. 1] the else: S = None return printStr (J) Print (printStr (STR)) "" " DEF Output (S, L): IF L == 0: return Print (S [L-. 1 ]) Output (S, L -1 ) S = INPUT ( "please input the str:\n") l = len(s) output(s,l)
Output:
-------- (I am dividing line) --------
reference:
1. RUNOOB.COM:https://www.runoob.com/python/python-exercise-example27.html
Remarks:
Initial modified: October 4, 2019 11:01:46
Environment: Windows 7 / Python 3.7.2