pythonExample100/JCP030.py

13 lines
328 B
Python
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden 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.

'''
题目一个5位数判断它是不是回文数。即12321是回文数个位与万位相同十位与千位相同。   
1.程序分析同29例
2.程序源代码:
'''
x = int(raw_input("input a number:\n"))
x = str(x)
for i in range(len(x)/2):
if x[i] != x[-i - 1]:
print 'this number is not a huiwen'
break
print 'this number is a huiwen'