ICode9

精准搜索请尝试: 精确搜索
  • Python 推导式 【Derivation】2022-08-12 18:33:15

    # 3.推导式 通过推导式,可以快捷方便的根据一个已有的 可迭代对象,生成一个新的对象 lst = list(range(1, 11)) # new_lst = filter(lambda x: x % 2 == 0, lst) # print(list(new_lst)) # [2, 4, 6, 8, 10] # new_lst = map(lambda x: x * 2, lst) # print(list(new_lst)) # [2

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有