29):1.题目:按相反的顺序输出列表的值. #!/usr/bin/python # -*- coding: UTF-8 -*- a = ['one', 'two', 'three'] for i in a[::-1]: print i 以上实例输出结果为: three two one #!/usr/bin/python # -*- coding: UTF-8 -*- print '输入列表格式为:1,2,3,4' s=input() print type(s) a=list(s…
27):题目:一个5位数,判断它是不是回文数.即12321是回文数,个位与万位相同,十位与千位相同. #!/usr/bin/python # -*- coding: UTF-8 -*- a = int(raw_input("请输入一个数字:\n")) x = str(a) flag = True for i in range(len(x)/2): if x[i] != x[-i - 1]: flag = False break if flag: print "…