生产器:
1:数字
a = [i+1 for i in range(10)]print(a)[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]2:str
a ='sadasfdasdfdasf'a = [i for i in a]print(a)['s', 'a', 'd', 'a', 's', 'f', 'd', 'a', 's', 'd', 'f', 'd', 'a', 's', 'f']
posted on 2018-10-19 13:41 别离 阅读(75) 评论(0) 编辑 收藏 举报