defmytest(): a=input("input a number: ") s=[] if a < 10: for i in range(a): s.append(i) elif a < 100: for i in range(a)[0:a:10]: s.append(i) else: while a > 0: a=a/100 s.append(a) return s
print([e for e in mytest() if e>1]) #重点
res=map((lambda x: x+3),mytest()) del res[0] print('re=%s retype=%s' % (str(res),str(type(res))))
print(dir("")) #打印string的全部属性和方法
m = re.search('[0-9]','abcd4ef') #参考http://www.cnblogs.com/vamei/archive/2012/08/31/2661870.html print(m.group(0))