pythonExample100/JCP027.py

21 lines
309 B
Python
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

'''
【程序27】
题目利用递归函数调用方式将所输入的5个字符以相反顺序打印出来。
1.程序分析:
2.程序源代码:
'''
def palin(n):
next = 0
if n <= 1:
next = input()
print
print next
else:
next = input()
palin(n - 1)
print next
i = 5
palin(i)
print