python判断给定的数是否是回文数此代码有很大的改进余地
#! /usr/bin/env python #coding=utf-8 a = input() b = str(a) flag = True for i in range(len(b)/2): if b[i]!=b[len(b)-i-1]: flag = False break if flag: print "%d is huiwen number!" % a else: print "%d is not huiwen number!" % a