python-day17--列表推导式,生成器表达式

# for i in range(100):
# print(i*i) 列表推导式:
# l =[i*i for i in range(100)]
# print(l) # l = [{'name':'v','age':28},{'name':'v'}]
# name_list = [dic['name'] for dic in l]
# print(name_list) 生成器表达式: 写法与列表推导式一样,把[]换成()
# l = [{'name':'v1','age':28},{'name':'v2'}]
# name_list_generator = (dic['name'] for dic in l)
# print(name_list_generator)
# print(next(name_list_generator))
# print(next(name_list_generator))
上一篇:邮件标准协议:MIME(Multipurpose Internet Mail Extensions)


下一篇:Flex中的折线图