Python3的列表推导式
摘要:
# -*- coding: utf-8 -*- li = [1,2,3,4,5,6,7,8,9]print ([x**2 for x in li]) print ([x**2 for x in li if x>5]) print (dict([(x,x*10) for x in li])) prin 阅读全文
posted @ 2017-09-15 11:37 sammy1989 阅读(422) 评论(0) 推荐(0) 编辑